Company: Placewit

Difficulty: medium

Problem Statement

Make Both Equal body { font-family: Arial, sans-serif; line-height: 1.6; margin: 20px; } .problem-container { max-width: 800px; margin: 0 auto; padding: 20px; border: 1px solid #ccc; border-radius: 8px; background-color: #f9f9f9; } h1, h2, h3 { color: #333; } .problem-description, .input-format, .output-format, .constraints, .examples { margin-bottom: 20px; } .example { background-color: #fff; padding: 15px; border: 1px solid #ddd; border-radius: 5px; margin-bottom: 15px; } pre { background-color: #f4f4f4; padding: 10px; border: 1px solid #ddd; border-radius: 5px; overflow-x: auto; } .explanation { margin-top: 10px; color: #555; } Make Both Equal You start with two integers, A and B , and want to drive them to the same value. On each move you may do exactly one of the following: Set A to A - B . Set B to B - A . Determine the fewest moves needed to make A and B equal, keeping in mind that neither value is ever allowed to drop below zero. Input Format Input is two space-separated intege

More Placewit OA questionsInterview experiences