We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I for the life of me cannot pass #11 and #13 at the same time. I may have over done it by writing a lexer,parser, and evaluator for this problem. My issue seems to be in my while evaluation trying to count the operations. I increment the counter when checking the while condition and then again after the body has been evaluated. Once the body is evaluated I recursively call my while eval so that the condition is checked again and counter increases again. This is perfect for 13 but 11 it is too few counts.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
BrainF__k interpreter
You are viewing a single comment's thread. Return to all comments →
I for the life of me cannot pass #11 and #13 at the same time. I may have over done it by writing a lexer,parser, and evaluator for this problem. My issue seems to be in my while evaluation trying to count the operations. I increment the counter when checking the while condition and then again after the body has been evaluated. Once the body is evaluated I recursively call my while eval so that the condition is checked again and counter increases again. This is perfect for 13 but 11 it is too few counts.