To the Top
File:  root - text - article - 2019 - 10 - create-a-simple-calculator.txt
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Category: Computing | 330 Views, 19975 Search Bots | 61 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by Google:

Given a mathematical expression with just single digits, plus signs, negative signs, and brackets, evaluate the expression. Assume the expression is properly formed.

Example:
Input: - ( 3 + ( 2 - 1 ) )
Output: -4
Here's the function signature:


def eval(expression):
# Fill this in.

print eval('- (3 + ( 2 - 1 ) )')
# -4
Tags: 每日算法题, 算法, 数据结构, 面试题, Daily Interview Problem, Data Structures and Algorithms, Computer Programming, | English | Home Page | Cateogry: Computing | 330 Views, 19975 Search Bots | 61 Words Subscribe to Feed Burner

Related Articles

  1. Two Tricks of Delphi
  2. New Vulnerabilities (CVE-2016-4581) have been detected in CentOS/RHEL/CloudLinux 7
  3. Daily Interview Problem: Deepest Node in a Binary Tree
  4. Making a Height Balanced Binary Search Tree
  5. Daily Interview Problem: Largest Product of 3 Elements I
  6. Daily Interview Problem: Longest Substring With K Distinct Characters
  7. Detect Linked List Cycle
  8. Daily Interview Problem: Look and Say Sequence
  9. Daily Interview Problem: Given two arrays, write a function to compute their intersection.
  10. [Daily Problem] Add two numbers as a linked list

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />