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

  Рет қаралды 40,694

Campusmonk

Campusmonk

Күн бұрын

Пікірлер: 35
@lubna2425
@lubna2425 Жыл бұрын
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)
@malavipande4642
@malavipande4642 Жыл бұрын
Thanks a million
@ronit712
@ronit712 Жыл бұрын
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?
@KomalSingh-qb3hx
@KomalSingh-qb3hx Жыл бұрын
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
@naveen5978
@naveen5978 3 ай бұрын
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)
@naveen5978
@naveen5978 3 ай бұрын
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)
@ankitpundhir9863
@ankitpundhir9863 Жыл бұрын
What if the frequency is given in more than 1 digit? Like a5g14c6b1a12b3
@akashpatil1676
@akashpatil1676 Жыл бұрын
Good question bhai👍
@DeveloperRB
@DeveloperRB 3 ай бұрын
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++; }
@ayushmaansural4896
@ayushmaansural4896 Жыл бұрын
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 3 ай бұрын
Can you please share the questions ?
@echelon7zulu
@echelon7zulu 3 ай бұрын
Was the exam proctored? Can we refer syntax
@nirajkantsingh1666
@nirajkantsingh1666 3 ай бұрын
Please tell me about the exam
@Rutujak116
@Rutujak116 Жыл бұрын
Thank you sir
@bangtangirl8784
@bangtangirl8784 2 ай бұрын
My personal laptop so slow...can i give hackerrank exam in wipro laptop?
@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); } }
@ritik.kumar15
@ritik.kumar15 8 ай бұрын
** 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); } }
@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 3 ай бұрын
Was the exam proctored? Can we refer syntax
@ritikajain9308
@ritikajain9308 Жыл бұрын
Kya hum javascript me code kr skte hai
@arkapravochakrabarti5517
@arkapravochakrabarti5517 Ай бұрын
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)
@akashroy4467
@akashroy4467 11 ай бұрын
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")
@mohammadsheesh
@mohammadsheesh Жыл бұрын
Good morning Sir
@Anshologey
@Anshologey Жыл бұрын
Good Morning
@I.Trista-d7c
@I.Trista-d7c 3 ай бұрын
Turner Corner
@rohitd09
@rohitd09 11 ай бұрын
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 3 ай бұрын
brother dont you think this code wont work when frequency is given in more than one digit like a10b5a2c7
@KomalSingh-qb3hx
@KomalSingh-qb3hx Жыл бұрын
//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); } }
@ritik.kumar15
@ritik.kumar15 8 ай бұрын
** 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()); } }
@BhaveshKumar-dz8hq
@BhaveshKumar-dz8hq 11 ай бұрын
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
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Support each other🤝
00:31
ISSEI / いっせい
Рет қаралды 81 МЛН
Medium Google Coding Interview With Ben Awad
51:27
Clément Mihailescu
Рет қаралды 1,3 МЛН
How to: Work at Google - Example Coding/Engineering Interview
24:02
Life at Google
Рет қаралды 7 МЛН
IBM Data Engineer SQL Interview Question (Hacker Rank Online Test)
8:21
How to STUDY so FAST it feels like CHEATING
8:03
The Angry Explainer
Рет қаралды 2,2 МЛН
GCD Program || Leet code || DSA
14:25
CodeWithYash
Рет қаралды 8
Google Coding Interview With A Facebook Software Engineer
49:59
Clément Mihailescu
Рет қаралды 949 М.