Problem is to evaluate a calculator string containing * / + - and brackets like "2+3*(4+2)/2/2" and the grammar for this is right associative for operators and precendence is as we know : -> unaray, brackets > */ > +-
Also answer should be in (mod 1000000007) which requires that every operation should be done with this mod.. For more detail please see https://www.hackerrank.com/contests/lambda-calculi-oct14/challenges/expressions-v2 However, i do NOT want any advantage in problem like some test cases that break my existing implementation, or somebody rewriting code for me. but definitely want advantages with the language like optimization or better way to do this task. Thanks Here are some of the results and test caes.. (= 1717 (int (first (Expression (make-calulator-list " 22 * 79 - 21"))))) (= 12 (int (first (Expression (make-calulator-list " 4/2/2 + 8"))))) (= 4 (int (first (Expression (make-calulator-list "4/-2/2 + 8"))))) (= 999998605 (int (mod (first (Expression (make-calulator-list "55+3-45*33-25"))) ToMod))) (= 999999987 (int (mod (first (Expression (make-calulator-list "4/-2/(2+8)"))) ToMod))) (= 22 (int (first (Expression (make-calulator-list "(22)*+1/-1+(1)"))))) (= 22 (int (first (Expression (make-calulator-list "11*(2/2)*2"))))) (= 11 (int (first (Expression (make-calulator-list "22*2/2*2"))))) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.