Java

Infosys infyTQ Coding JAVA, Python Question7 infyTQ Previous Slot Coding Question & Answer Explained



#infyTQ #Infosys #InfosysCertification #CodingCompetetion #Interviews #Coding #Placement

In this video we will study our 7th question of Infosys infyTQ i.e. “Character Shifting in Dictionary” in python. We are trying to provide you the best solutions with Easiest Explanation with only one motto “Quality Content!! A Step Toward Simplification”

infyTQ Final Round Questions | infyTQ Previous Slot Programming Question | Answers Well Explained with Code | Solution in Java and Python | 100%…

9 thoughts on “Infosys infyTQ Coding JAVA, Python Question7 infyTQ Previous Slot Coding Question & Answer Explained

  1. # i think the prob can be done with complexity of O(n) . Here's the solution! Kindly check!

    input_str = "bcdgfgh:127836"
    sum1 = 0
    list1 = []
    list2 = []
    for val in input_str :
    if val.isnumeric() :
    list1.append(int(val))
    if val.isalpha() :
    list2.append(val)

    for num in list1 :
    sum1 += (num**2)
    if sum1 % 2 == 0 :
    list2.insert(0,list2[len(list2)-2])
    list2.insert(1,list2[len(list2)-1])
    list2.pop(len(list2)-1)
    list2.pop(len(list2)-1)

    else :
    list2.append(list2[0])
    list2.pop(0)
    out = ''.join(list2)
    print(out)

Leave a Reply

Your email address will not be published. Required fields are marked *