Java/C++ (and Python) simple greedy
First, I must note that this problem does not feel like \'Easy\'. The implementation is easy, but the intuition is not. In fact, I spent more time on this probl
First, I must note that this problem does not feel like \'Easy\'. The implementation is easy, but the intuition is not. In fact, I spent more time on this problem then on other \'Medium\' problems in the contest.\n\n- If the initial number of As is greater than Bs, we swap A and B.\n- For each turn, we add \'a\' to our string.\n- If the number of remaining As is greater than Bs, we add one more \'a\'.\n- Finally, we add \'b\'. \n<iframe src="https://leetcode.com/playground/VkpuNFz6/shared" frameBorder="0" width="100%" height="210"></iframe>\n\nIf you feel rather functional, here is a 3-liner (on par with the Python solution, courtesy of [@zengxinhai](https://leetcode.com/zengxinhai)):\n<iframe src="https://leetcode.com/playground/wkpugsHY/shared" frameBorder="0" width="100%" height="150"></iframe>
[]