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 spent like 10 hours trying to do this the hard way. When I figured out the easy way I did it in 5 minutes during a business meeting. Do yourself a favor:
For input "99100", grab the first digit 9 and build beautiful string 91011, and check whether it's identical to 99100, It's not. So grab the first 2 digits 99 and build beautiful string 99100. It's identical, so "YES 99".
Don't try to stairstep a left index and a right index or dynamically keep track of curernt index length or anything. Save it for the harder questions lmao.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Separate the Numbers
You are viewing a single comment's thread. Return to all comments →
I spent like 10 hours trying to do this the hard way. When I figured out the easy way I did it in 5 minutes during a business meeting. Do yourself a favor:
For input "99100", grab the first digit 9 and build beautiful string 91011, and check whether it's identical to 99100, It's not. So grab the first 2 digits 99 and build beautiful string 99100. It's identical, so "YES 99".
Don't try to stairstep a left index and a right index or dynamically keep track of curernt index length or anything. Save it for the harder questions lmao.