Company: Visa__

Difficulty: medium

Problem Statement

Problem Description Suppose you're building a chat app and want to add a playful feature that flips the case of whatever text a user types, just for fun. Given a string inputText made up of uppercase and lowercase English letters, spaces, digits, and punctuation marks, write a function that swaps the case of every alphabetic character in it — uppercase becomes lowercase and lowercase becomes uppercase — while every non-letter character stays exactly as it was. Return the resulting string with every letter's case flipped. Note: You are not expected to provide the most optimal solution, but a solution with time complexity not worse than O(inputText.length) will fit within the execution time limit. Examples Example 1 Input: inputText = "Hello, World!" Output: "hELLO, wORLD!" Explanation: Every alphabetic character in inputText has its case flipped — uppercase turns into lowercase and lowercase turns into uppercase — while punctuation and other non-letters are left untouched. Example 2 Inp

More Visa__ OA questionsInterview experiences