IBM Coding Assessment Questions July 2024 | Software Engineer | Freshers | Must Watch before Test

Поділитися
Вставка
  • Опубліковано 23 лис 2024

КОМЕНТАРІ •

  • @Haifajundi
    @Haifajundi 4 дні тому

    is it possible to be the same question for SWE intern now ?

  • @akashxdev
    @akashxdev 3 місяці тому +1

    If the palindrome is "aba" then after replacing 'b' with 'a' it will be still a palindrome "aaa"

    • @Leetcore-2508
      @Leetcore-2508  3 місяці тому +1

      sorry, in the for loop we only need to iterate only halfway through the string.
      The corrected code is as follows:
      string breakPalindrome(string& palindromeStr) {
      int n = palindromeStr.size();
      // base case
      if(n == 1)
      return "IMPOSSIBLE";
      for(int i = 0; i < n/2; i++) {
      if(palindromeStr[i] != 'a') {
      palindromeStr[i] = 'a';
      return palindromeStr;
      }
      }
      return "IMPOSSIBLE";
      }

    • @hjim4331
      @hjim4331 4 дні тому

      @@Leetcore-2508 the updated loop also incorrect, if we have "aaaabaaaa", we can change the latest character to b, so the string is "aaaabaaab", I think that is the answer, but if we run the code then it will have answer of impossible

  • @vedangjadhav3036
    @vedangjadhav3036 25 днів тому

    How many days there reply comes back

  • @Leetcore-2508
    @Leetcore-2508  3 місяці тому +2

    Link to the document: drive.google.com/file/d/1xCSRbO95xxq5KJE8cVoK7iTskxnZqbBw/view?usp=sharing

  • @Leetcore-2508
    @Leetcore-2508  3 місяці тому +1

    Join my Telegram Group for Coding and Interview Discussions: t.me/+P87TYGAe7-w2ZjU1