Комментарии:
a real programmer won’t go outside
ОтветитьThat sum questions.
static int[] sum(int[] arr, int sum) {
for (int i=0; i<arr.length-1; i++) {
for (int j=i; j<arr.length; j++) {
if (arr[i] + arr[j] == sum)
return new int[] {arr[i], arr[j]};
}
}
}
This also works cause gives same output. Is this code correct for that question??
first lady, when she say reverse method.. she have find the solution. Honestly stop pushing this fucking 1980 for loop methods kids, is 2023 and guess.. are even slower.
ОтветитьHow do you handle a situation where you can MORE THAN 2 numbers to equal the sum?
ОтветитьThe first one is just return string[::-1]
ОтветитьA real chad would just ask the problem then google it if he doesn't know
Ответить"Java doesn't work." 🗿🗿
Ответитьworst cameraman ever. leave this field pls
Ответитьarr = [1,3,5,6,11,23]
def twoSum(arr,Sum):
app=0
for i in range(len(arr)):
app+=arr[i]
if app==Sum:
break
return app
print(twoSum(arr,9))
The first one who tried to reverse a string, her boyfriend who stood there was crazy thinking his life got reversed and now kenny is asking to just reverse a string, which was actually proved by her gf😂😂
ОтветитьImagine getting 200 bucks for each leetcode medium question
ОтветитьI think it will be better if WE could see easier the exercice , so maybe used a picture with the stuff write on it with the solution explain that would bé better
Ответить1) a = input()
print(a[::-1])
😂😂😂i wish to be in their places!!! if only real programming interviews questions were that easy😂😂😂like "iterate through this 2D array and return the sum of the elements"!!! that's like an O(n) question!!!😂😂😂😂😂😂😂😂
Ответитьcameraman stay still bruh..plzz
ОтветитьIn python just do string[::-1]
Why actually do for loop
100$ for reversing a string 🤣 man I worked on a full fledged website for around 1.5 moths for a hackathon that didn't even pay me that much
ОтветитьSWO!!
ОтветитьThat TWO SUM problem - gosh i finally learnt how to solve it after THREEEE weeks from not knowing a single thing about coding - every single WORD of code felt like being hit by 1000 new bricks, it was probably the hardest thing to ever wrap my head around n now when i think about it - its SUPER logical and optimized
- I remember the most concept i codnt fathom was how is a hash map able to sore a key and be able to retrieve it instantly.. that concept I just couldnt wrap my head around. Like how can a hashmap be able to INSTANTLY point to its location in the memory or whatever magical place keys get stored at.. fuk now that i am typin this i am not even sure i fully know!