Crack the IBM Coding Round in Just 20 Mins! 🚀 | Coding Series🔥

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ม.ค. 2025

ความคิดเห็น • 35

  • @lubna2425
    @lubna2425 ปีที่แล้ว +3

    s = input("Enter a string: ")
    a = [0] * 255
    for i in range(0, len(s), 2):
    a[ord(s[i])] += int(s[i + 1])
    ans = ""
    for i in range(255):
    if a[i] != 0:
    ans += chr(i)
    ans += str(a[i])
    print("Output:", ans)

  • @KomalSingh-qb3hx
    @KomalSingh-qb3hx ปีที่แล้ว +4

    question 1 in java
    import java.util.*;
    public class ibm2 {
    public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    String s=sc.nextLine();
    int ch1[]=new int[255];
    for(int i=0;i

  • @ronit712
    @ronit712 ปีที่แล้ว +1

    code for binary to decimal
    #include
    using namespace std;
    int main(){
    int binary=111,decimal=0,x=0;
    while(binary>0){
    int rem=binary%10;
    decimal+=pow(2,x);
    x++;
    binary=binary/10;
    }
    cout

    • @ronitsrivastava377
      @ronitsrivastava377 4 หลายเดือนก่อน

      Integer.toBinaryString(64);
      in Java. C++ has something similar?

  • @naveen5978
    @naveen5978 4 หลายเดือนก่อน

    Binary to decimal:
    s = int(input('Enter: '))
    res = 0
    counter = 0
    while s!=0:
    res += (2**counter)*(s%10)
    s = s//10
    counter+=1
    print("Output:", res)

  • @ankitpundhir9863
    @ankitpundhir9863 ปีที่แล้ว +5

    What if the frequency is given in more than 1 digit? Like a5g14c6b1a12b3

    • @akashpatil1676
      @akashpatil1676 ปีที่แล้ว +1

      Good question bhai👍

    • @DeveloperRB
      @DeveloperRB 4 หลายเดือนก่อน

      we have to parse the value like:
      char key = s[i]; // The character key
      i++; // Move to the next character which should be the start of the number
      // Extract the number which may have multiple digits
      int value = 0;
      while (i < s.length() && isdigit(s[i])) {
      value = value * 10 + (s[i] - '0');
      i++;
      }

  • @naveen5978
    @naveen5978 4 หลายเดือนก่อน

    s = input("Enter: ")
    chk_array = [0]*255
    res = ""
    for i in range(1,len(s),2):
    chk_array[ord(s[i-1])] += int(s[i])
    for i in range(len(chk_array)):
    for j in range(chk_array[i]):
    res += chr(i)
    print(res)

  • @ayushmaansural4896
    @ayushmaansural4896 ปีที่แล้ว +7

    Hi Team, I had IBM coding round on 31st of August (ON_Campus) and questions were super huge and complex. Some required concepts from DP too.

    • @20-ECE-145ShivamKumar
      @20-ECE-145ShivamKumar ปีที่แล้ว

      which clg

    • @ayushmaansural4896
      @ayushmaansural4896 ปีที่แล้ว

      @@20-ECE-145ShivamKumar Tier 3 college of Kolkata-

    • @MARIAM-eb9zw
      @MARIAM-eb9zw 4 หลายเดือนก่อน

      Can you please share the questions ?

    • @echelon7zulu
      @echelon7zulu 4 หลายเดือนก่อน

      Was the exam proctored? Can we refer syntax

    • @nirajkantsingh1666
      @nirajkantsingh1666 4 หลายเดือนก่อน

      Please tell me about the exam

  • @ritik.kumar15
    @ritik.kumar15 9 หลายเดือนก่อน

    ** Ques-1 : JAVA Solution using single loop **
    import java.util.HashMap;
    import java.util.Map;
    import java.util.stream.Collectors;
    public class Test7 {
    public static void main(String[] args) {
    String compStr = "a3b2c5a1g9c2";
    Map map = new HashMap();

    for (int i = 0; i < compStr.length(); i+=2) {

    if (!map.containsKey(compStr.charAt(i))) {
    map.put(compStr.charAt(i), Character.getNumericValue(compStr.charAt(i+1)));
    } else {
    map.replace(compStr.charAt(i), map.get(compStr.charAt(i)) + Character.getNumericValue(compStr.charAt(i+1)));
    }
    }

    String correctStr = map.entrySet().stream().map(e -> e.getKey()+""+e.getValue()).collect(Collectors.joining(""));

    System.out.println(correctStr);

    }
    }

  • @bangtangirl8784
    @bangtangirl8784 3 หลายเดือนก่อน

    My personal laptop so slow...can i give hackerrank exam in wipro laptop?

  • @Rutujak116
    @Rutujak116 ปีที่แล้ว +1

    Thank you sir

  • @ritikajain9308
    @ritikajain9308 ปีที่แล้ว

    Kya hum javascript me code kr skte hai

  • @suryaprasadpadhi2525
    @suryaprasadpadhi2525 6 หลายเดือนก่อน

    I gave coding assessment for back-end developer I completed Java but while writing half of the sql my time over... So can I get selected for next English round

    • @handsome_devil2747
      @handsome_devil2747 6 หลายเดือนก่อน

      what was the question can u tell i am written today

    • @echelon7zulu
      @echelon7zulu 4 หลายเดือนก่อน

      Was the exam proctored? Can we refer syntax

  • @I.Trista-d7c
    @I.Trista-d7c 4 หลายเดือนก่อน

    Turner Corner

  • @arkapravochakrabarti5517
    @arkapravochakrabarti5517 2 หลายเดือนก่อน

    Bhaiya 1 ka ye dekha jara
    s="a3b2c5a1g9c2"
    d={}
    for i in range(0,len(s),2):
    char=s[i]
    freq=int(s[i+1])
    if char not in d:
    d[char]=freq
    else:
    d[char]+=freq
    res=""
    for char in sorted(d.keys()):
    res+=char
    res+=str(d[char])
    print(res)

  • @KomalSingh-qb3hx
    @KomalSingh-qb3hx ปีที่แล้ว

    //program to convert decimal number to binary number
    import java.util.*;
    public class ibm3 {
    public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int rem=0;
    StringBuffer sb=new StringBuffer();
    while(n>0){
    rem=n%2;
    sb.append(rem);
    n=n/2;
    }
    sb.reverse();
    System.out.println(sb);
    }
    }

  • @akashroy4467
    @akashroy4467 ปีที่แล้ว

    For 1st question we can use this solution :
    import Foundation
    var mainArr = ["g","2","b","4","a","2","c","5","a","1","Z","7","A","4"]
    var ansArr = [String]()
    for var i in 0..0 {
    ansArr.append(name)
    ansArr.append(String(count))
    }
    }
    print("Hi:",ansArr )
    print("Hello World")

  • @ritik.kumar15
    @ritik.kumar15 9 หลายเดือนก่อน +1

    ** Ques -2 : JAVA Solution **
    import java.util.Scanner;
    public class Test8 {
    public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int num = sc.nextInt();
    sc.close();

    String binNum = "";

    while (num != 1) {

    binNum += num % 2;
    num /= 2;

    }

    binNum += num;

    System.out.println(new StringBuilder(binNum).reverse().toString());

    }
    }

  • @mohammadsheesh
    @mohammadsheesh ปีที่แล้ว +2

    Good morning Sir

  • @rohitd09
    @rohitd09 ปีที่แล้ว

    Python solution using dict:
    import string
    st = input('Enter incorrectly compressed string: ')
    dt = {}
    for i in st:
    if i.isalpha():
    dt[i] = 0
    for i in range(len(st)):
    if st[i].isalpha():
    dt[st[i]] += int(st[i+1])

    print(dt)
    ls_keys = list(dt.keys())
    ls_keys.sort()
    dt_sorted = {i:dt[i] for i in ls_keys}
    ls_sorted_keys = list(dt_sorted.keys())
    ls_vals = list(dt_sorted.values())
    print(dt)
    correct_st = ''
    dt_len = len(dt)
    print(dt_len)
    for i in range(dt_len):
    correct_st = correct_st + ls_keys[i] + str(ls_vals[i])
    print(correct_st)

    • @ramkrishnak6371
      @ramkrishnak6371 4 หลายเดือนก่อน

      brother dont you think this code wont work when frequency is given in more than one digit like a10b5a2c7

  • @BhaveshKumar-dz8hq
    @BhaveshKumar-dz8hq ปีที่แล้ว

    st = 'a3b2c4a4d6b5'
    l = list(st)
    d={}
    srr=''
    lt=[]
    l1=l[::2]
    l2 = set(l1)
    l3=list(l2)
    l3.sort()
    for i in l3:
    d[i]=l1.count(i)
    ll=list(d.items())
    ln=len(ll)*2
    for j in ll:
    for i in j:
    lt.append(i)
    for t in lt:
    srr=srr+str(t)
    print(srr)
    ##python code

  • @KomalSingh-qb3hx
    @KomalSingh-qb3hx ปีที่แล้ว +1

    //program to convert binary number to decimal number
    import java.util.*;
    public class ibm4 {
    public static void main(String []args){
    Scanner sc=new Scanner(System.in);
    String s=sc.nextLine();
    StringBuffer sb=new StringBuffer(s);
    sb.reverse();
    s=new String(sb);
    int n=Integer.parseInt(s);
    int rem=0;
    double dec=0;
    int i=0;
    while(n>0){
    rem=n%10;
    dec=dec+rem*Math.pow(2,i);
    i++;
    n=n/10;
    }
    int ans=(int)dec;
    System.out.println(ans);
    }
    }