How i've failed programming challenge on Turing.com

Поделиться
HTML-код
  • Опубликовано: 6 янв 2025
  • Thats how its done when there is no preparation and warm up.
    1. I tried to copy the template to VSCode using Ctrl+C - Ctr+V and just messed up the template.
    2. Incorrectly read the task. It should do reverse() not sort().
    3. Did too little sample tests (thats why in showed OK inspite of major logical mistake).
    4. I didn't do any warmups for a month. In fact i haven't coded in a while - thats why i kept forgetting regex.
    5. And all that lead to complete lack of time for a second challange.
    And finally - when recording (or programming when someone watching) you make a lot more mistakes. Thats how i failed toptal.com last year (i did passed online tests), but failed really simple one on an interview.
    So im gonna continue filming my attempts at taking tests - i hope it is a good practice for live interviews.

Комментарии • 169

  • @honorebarera8171
    @honorebarera8171 5 месяцев назад +32

    Not many developers have the courage to show their failures. Thanks Brother

    • @IgorKravets81
      @IgorKravets81  5 месяцев назад +2

      @@honorebarera8171 thanks 🙏

  • @waifufx
    @waifufx Год назад +72

    I love the fact that you had the courage to open a real test, I am also in the Coding Challenge Phase too, I am just inspired. Good work Sir

    • @kevinobuya6013
      @kevinobuya6013 Год назад +1

      I have done the coding challenges more than ten times and have passed, with different emails.

    • @skzahirulislam2820
      @skzahirulislam2820 Год назад +1

      ​@@kevinobuya6013same question every time ?

    • @davidaddis2525
      @davidaddis2525 Год назад

      @@kevinobuya6013 are you hired right now?

    • @irfansaeedkhan7242
      @irfansaeedkhan7242 Год назад

      @@kevinobuya6013 do you teach as well ? i want to pass as well,

    • @sameer9641
      @sameer9641 9 месяцев назад

      @@kevinobuya6013 Hi there I want to pass this coding and I am really working hard please can you give this question so will practice and will be able to clear it

  • @the_CodingTraveller
    @the_CodingTraveller Год назад +22

    Respect for going live with this, very nice. Keep it up.

    • @IgorKravets81
      @IgorKravets81  Год назад

      Thanks!

    • @jyoshnasaripilli
      @jyoshnasaripilli 9 месяцев назад

      @@IgorKravets81 Have you passed the test now? You got job through Turing?

  • @oinn6216
    @oinn6216 Год назад +7

    It was really fun. Anger, depression, hate and hope all in one video. Good luck next time :)

  • @SyedaTabassum.
    @SyedaTabassum. 3 месяца назад +1

    Your courage is much appreciated 👍🏼.

  • @jpg6113
    @jpg6113 Год назад +10

    Thank you for posting this! I also made the mistake of underestimating it and just going in without any practice for months.

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      Next time will be much easier!

    • @nikasamkharadze4656
      @nikasamkharadze4656 Год назад +1

      so its not a rush? ive been getting emails from turing encouraging me to take test? because it think its better to practice for a while for me too ..

  • @mubashirwaheed474
    @mubashirwaheed474 Год назад +5

    29:00 "Yeah I am not gonna make it in two minutes" cracked me up lmao but thanks for the video tho

  • @bosterjack
    @bosterjack 4 месяца назад +1

    You're sincere and I appreciate that.

  • @hextiandro
    @hextiandro Год назад +5

    Yo vi tu video ahora, y te agradezco mucho por compartir este sensacional video 🚀🚀🚀

  • @aadil4236
    @aadil4236 9 месяцев назад +3

    Thank you sir! I appriciate your effort. I learned a lot!

  • @finzyphinzy
    @finzyphinzy 3 месяца назад +3

    how would i solve this?
    get an array or string of the input string that’s are only letters and reverse it.
    loop through the original input.
    if input[i] !== “-“. add the last element of the reverse string or array to the result or output str. else; all “-“

  • @programmingchannel6264
    @programmingchannel6264 11 месяцев назад +6

    I failed the challenge too, I felt my first question didn't give me enough information or explanation to solve it, so I by passed and solved the second challenge in less than 5 minutes. Even though I failed the challenge, the tiring profile opened for me. Am just going to fill the profile while waiting for a response

    • @JourneyWithMohsin
      @JourneyWithMohsin 9 месяцев назад +2

      So what happened, did you make it?

    • @PrinceSingh-fd6jg
      @PrinceSingh-fd6jg Месяц назад

      I passed turing test yesterday and I got a mail from the turing in which they told me I have passed all the test and my application has been forwarded. I don't know what happens next. Any advice

    • @dinesh11153
      @dinesh11153 Месяц назад

      @@PrinceSingh-fd6jg did u have a work experience

    • @PrinceSingh-fd6jg
      @PrinceSingh-fd6jg Месяц назад

      @@dinesh11153 yes, I applied for research analyst position and the test that was given to me was related to job that I am currently doing so I was very easy for me to clear.

  • @mukailarashid5428
    @mukailarashid5428 Год назад +4

    Thanks for sharing! I really needed it.

  • @PahellyChakma-mz5vq
    @PahellyChakma-mz5vq 4 месяца назад +2

    Use 2 pointers approach to solve the problem and make sure to check if the current character is an Alphabet

  • @mikaa2557
    @mikaa2557 3 месяца назад +2

    Haha I applied for data science and gave the test but then coding round I got so irritated bec I didnot understand where to write code and all despite instruction got frustrated and just wrote 4 lines and closed it. First time ig I will remember this when I practice coding everytime

  • @MecksOnwenu
    @MecksOnwenu Год назад +4

    You did your best bro! I have been in that scope before

    • @IgorKravets81
      @IgorKravets81  Год назад +2

      Thanks. Still I should have been more prepared )

    • @MecksOnwenu
      @MecksOnwenu Год назад

      @@IgorKravets81 Of course especially in time management

    • @DavidTheWiseOne
      @DavidTheWiseOne Год назад

      @@IgorKravets81 I have a question dear friend and that question is do they ask you to open the camera? how can i prepare for it?

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      @@DavidTheWiseOne No they did not ask for the camera, at least when I took the test...

  • @sushilsethi1702
    @sushilsethi1702 2 месяца назад +1

    Reverse position all the letters in the string but keep position of special characters the same.

  • @ddarlio4015
    @ddarlio4015 Год назад +10

    you can not copy and paste in the turing editor.. something important to note

    • @roymauya6853
      @roymauya6853 Год назад

      Thanks 😂😂

    • @kravetzpm
      @kravetzpm Год назад +2

      disable javascript, copy and paste, enable javascript

    • @khalifarmili1256
      @khalifarmili1256 Год назад

      you will i guess have to reload the page when you disable JS@@kravetzpm

  • @quocthai9382
    @quocthai9382 10 месяцев назад +1

    Just need two pointer and check variables for each pointer, right?

  • @Martin-Kalema
    @Martin-Kalema 5 месяцев назад +1

    The first question was all about two pointers.

  • @ruyvieira104
    @ruyvieira104 Год назад +5

    I passed those, but when i tried the "practical nodejs challenge" I failed because the question was written in such a way that it was hard to understand what the person tried to say.
    "the product_list payload contains a few parameters and all should be validated, and throws TypeError / RangeError / InvalidInputError to the caller if anything does not meet the specification"
    What exception type for what type of error? Was the function supposed to return a "product_list" ? Why, if it's asking for a single product to be "validated"?
    Insanely bad

    • @IgorKravets81
      @IgorKravets81  Год назад +2

      Yeah, sounds like fun. I guess you have to get used to those tests to get comfortable. Or just work at some company where humans lead the interview right from the start

    • @pratikgohil7821
      @pratikgohil7821 9 месяцев назад +1

      did you manage to complete the practical challenge?
      i faced the same problem, I could not understand the question.

    • @ruyvieira104
      @ruyvieira104 9 месяцев назад

      @@pratikgohil7821 nope. I deleted my account on turing as well.

    • @abayomioluga7073
      @abayomioluga7073 9 месяцев назад

      ​@@pratikgohil7821hey bro, I also passed the coding challenge but failed the Node.js practical challenge, the question was very confusing. I do not want to complete my profile yet until I am through with all practical challenges, what is the next step after completing the practical challenge?

    • @shelldog7215
      @shelldog7215 6 месяцев назад

      ​@@pratikgohil7821 I just aced their first coding interview round a hour ago, man it was a pain.
      stage 1: submit CV
      stage 2:
      - they asked some bunch of stupid shit questions about JavaScript and Python.
      - Python questions are even more painful, it asked you about the lib asyncio, thread, single thread, tests, etc. But 20/30 questions are about thread already and god it was so so painful.
      - JavaScript, somehow lucky to pass.
      stage 3:
      - 2 leetcode problems, they required you to write document after you finished your solutions.
      - the first problem is around easy-medium (for me because I solved around 250 leetcode problems so far).
      - the second problem is easy honestly
      GOD! Their IDE was so shitty, if you accidentally make an infinite loop, the compiler will just stuck. You can't even allow to use VIM because they don't have that option yet. But I heard they are scammer, so not really care if I passed or not.

  • @havefun5519
    @havefun5519 8 месяцев назад +1

    Seems 2 problem-solving coding challenges, as long as pass one, it will be passed. I've failed the coding challenge for a TDD assignment, 2 reasons, my bad, first face TDD assignment, 2nd I like testing after I coding sth, but the system seems slow but the time is flys. So finally, I fail.

  • @abdulrafayakber3798
    @abdulrafayakber3798 9 месяцев назад +2

    i think you can just add these string characters reversely into array and then just convert it into string .This is an easy method
    let str='ab-cd'
    let newStr=[]
    for (let i = 0, j = str.length - 1; i < str.length; i++, j--) {
    newStr[j] = str[i];
    }
    // Convert the array back to a string
    newStr = newStr.join('');
    console.log(newStr)

    • @tadekaldas1992
      @tadekaldas1992 4 месяца назад

      this works only for this test case

  • @LifeTravel-p6u
    @LifeTravel-p6u Год назад +3

    You did well bro.

  • @anuragbisen5871
    @anuragbisen5871 15 дней назад

    I have also completed our profile to solve programming questions. I am in the last step. If you know anything about what happens after that then please tell me.

    • @IgorKravets81
      @IgorKravets81  15 дней назад +1

      @@anuragbisen5871 I don't, sorry. Good luck!!

  • @SomtoMaduewesi
    @SomtoMaduewesi 9 месяцев назад +1

    Wow. You did a good job. The only thing I think you missed was you used an array sort method instead of an array reverse method, on the array with only letters.
    Anyways. I never would have solved this honestly. 😂

  • @boris3393
    @boris3393 Год назад +1

    The answer for me was use ascii of every number and ascii str1 - ascii str2 and you will find the letrero and convert to letter

    • @brewingentertainment824
      @brewingentertainment824 6 месяцев назад

      How about using character.isLetter() (in java) method to check alphabets and reversing the String?

  • @markmendez1014
    @markmendez1014 Год назад +24

    Very good coders fail these tests all the time because of anxiety, unclear questions or just a poor editor like the one on Turing. It does not mean you are stupid.
    First time I did one I was so angry because I’m a frontend dev and did not expect to be asked to write someone stupid palindrome algo lol 😂
    A better way to test is to ask to solve common problems you will encounter as a developer.

    • @bozzistef
      @bozzistef Год назад +3

      I agree with you. I have a computer science degree and I work as a frontend too. I've practiced a lot of algorithms and data structures problems since I've been in university but it still hard to take a problem like the second one if you have not been practicing recently. Also it is not correlated for a frontend position.

    • @IgorKravets81
      @IgorKravets81  Год назад +5

      @@bozzistef also at current job I sometimes get stuck on the problem even without time pressure. For example with some weird css someone left me to figure out. Doesn't mean I'm stupid. Eventually I solve it and get better.

    • @anaalmeida2327
      @anaalmeida2327 11 месяцев назад +2

      I thought I was the only one with this same opinion. I’ve been a front end for four years now and I was thinking I was the only stupid front end developer that couldn’t write those algos seamlessly.

  • @meetpatel.47
    @meetpatel.47 Год назад

    Can you tell me what further goes after passing skill assessment ?

  • @nathnaeldereje5127
    @nathnaeldereje5127 6 месяцев назад +1

    Thanks for sharing bro.

    • @IgorKravets81
      @IgorKravets81  6 месяцев назад

      I'm glad it is somehow useful! Thanks

  • @ddarlio4015
    @ddarlio4015 Год назад +2

    the environment is very weird... the output is kind of hidden

    • @adeyvincent3570
      @adeyvincent3570 Год назад

      I have thesame concerns. It thing it’s unnecessarily complicated. Did you get to retake it ?

    • @IgorKravets81
      @IgorKravets81  Год назад

      No it was not hidden. I just didn't see it at first. Because I took training test a couple of weeks ago so I completely forgot where to look for console output

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      @@adeyvincent3570 no I did not retake it yet. I got employed by conventional old style way by applying to particular company

  • @ramses_talks
    @ramses_talks 9 месяцев назад

    Are you allowed to switch tabs in turing tests? Isn't your screen recorded?

  • @meetpatel.47
    @meetpatel.47 Год назад

    In coding test what they ask basically?

  • @wickedknock9798
    @wickedknock9798 10 месяцев назад +1

    Brave man than 90 percent ty

  • @aaronbaron6468
    @aaronbaron6468 5 месяцев назад

    strange question to ask but are you using the akg k240 headphones?

    • @IgorKravets81
      @IgorKravets81  5 месяцев назад

      Not sure they are Sennheiser something. My cable eventually broke and I could not find replacement here in Turkey. So I put them somewhere and can't see the model now.

  • @SYNTHv3
    @SYNTHv3 6 месяцев назад

    Bit long but works I think?
    solution for 1 :
    const letters = []
    const temp = input.map((n) => {
    if(a letter(regex filter)){
    letters.push(n)
    return "x"
    }
    return n
    })
    const resLetters = letters.reverse()
    const currentLetterIndex = 0
    const result = temp.map((n) => {
    let value = n
    if("x" === n){
    value = resLetters[currentLetterIndex)
    ++ currentLetterIndex
    }
    return value
    }

  • @buomkuothyian2999
    @buomkuothyian2999 4 месяца назад

    Wait, are we allow to google the answers?

  • @PeterXyzdlv
    @PeterXyzdlv 6 месяцев назад +1

    That would be simple for me, left and right pointers and skipping characters.

  • @SYNTHv3
    @SYNTHv3 6 месяцев назад

    Couldny u juat copy the question in to chat gpt

  • @didierliango6402
    @didierliango6402 Год назад +1

    Very nice video.

  • @DineshHangal
    @DineshHangal Год назад +4

    test =(str)=> {
    return str.split("").reverse().join().replaceAll(',',"");
    }
    let res = test("ab-cd");
    console.log(res)

    • @SYNTHv3
      @SYNTHv3 6 месяцев назад

      doesn't work

  • @sohantirpude2455
    @sohantirpude2455 7 месяцев назад

    Isn't whatever your are logging in console there in result section?

  • @rahul_spawar
    @rahul_spawar 4 месяца назад

    How many rounds are there before they hire you? Also is the process same for all tech stacks

    • @IgorKravets81
      @IgorKravets81  4 месяца назад

      @@rahul_spawar I can't tell since I did not pass ) usually next goes online audition - kinda same task, but while on zoom

  • @markmendez1014
    @markmendez1014 Год назад +15

    My solution would have been to remove the non letters and store them in a hash map with their indexes
    Then reverse the string and reinsert them using splice()

    • @viktor8050
      @viktor8050 Год назад +1

      You could just do this if you want to make it step by step easy, reverse the string, and loop Trough the first string and if its a letter replace its index with the reverse string index.

    • @jaia466
      @jaia466 Год назад

      Also what im thinking

    • @AlamKhan-yt9wd
      @AlamKhan-yt9wd Год назад

      But insert using splice() take O(N) time.
      So, ultimately, it becomes O(N^2)

    • @kalirocketdev
      @kalirocketdev 3 месяца назад

      ​@AlamKhan-yt9wd yea but in tests like this, you just want to pass, in real you could further improve on your algo, would waste time trying to optimize

  • @theuncannyepicurean
    @theuncannyepicurean Год назад +4

    Are you allowed to google during the test?

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      I should hope so. Although I noticed the page seemed to react to switching tabs. Possibly it was taking notice on distractions.

    • @ddarlio4015
      @ddarlio4015 Год назад

      @@IgorKravets81 true.. I think it is monitored

    • @olivierloukombo2082
      @olivierloukombo2082 Год назад +2

      It's possible but you only have 30 minutes for two problems. I don't think that's good time management. That's why you have to master DSA.

  • @ThePaisan
    @ThePaisan 3 месяца назад

    What why they are not monitoring the test? What if someone uses chatgpt

    • @thakurj647
      @thakurj647 22 дня назад

      Screen is recorded

    • @ThePaisan
      @ThePaisan 21 день назад

      @ by using a mobile take a pic and chatgpt. Type the code in pc done. Isn’t that cheating.

  • @susheelkumar291
    @susheelkumar291 Год назад +2

    You did well

  • @surekhasetty9753
    @surekhasetty9753 11 месяцев назад

    After completion of coding challenge what is the next step?

    • @IgorKravets81
      @IgorKravets81  11 месяцев назад +1

      In my case: post a video of a failure ) although couple of years ago I passed similar test for toptal.com site and the next step was one more similar test, but online via a zoom call. I didn't pass that one, so I don't know what are steps beyond that.

  • @bilalaslam6159
    @bilalaslam6159 Год назад +1

    Is it allowed to google during test ?

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      I'm not sure if it is forbidden. But you could switch to another window during the process. Maybe it is logged somehow though

  • @supremeksd
    @supremeksd 5 месяцев назад +1

    thanks man

  • @ijasdeen3809
    @ijasdeen3809 Месяц назад

    What are you being interviewed for?

    • @IgorKravets81
      @IgorKravets81  Месяц назад

      @@ijasdeen3809 in this particular case I did not get past these automated tests.

  • @cengizbalta6371
    @cengizbalta6371 5 месяцев назад +1

    lion igor ..

  • @sergiocoder
    @sergiocoder Год назад +4

    Can anyone confirm that Turing is a legit way to find jobs? I passed a coding challenge and a few tech stack tests, but failed the practical challenge because their IDE is utterly slow and lacks autocomplete.
    And I'm also starting to doubt about the quality of this service - first of all, it's kind of silly that they advertise about "U.S. companies" jobs like every developer on the planet dreams to work for a USA company, secondly their quizzes are just some low quality garbage written by a junior dev, and moreover the questions often have nothing to do with the technology itself but rather with some popular 3rd-party library.
    Also, RUclips is full of positive reviews published on their own channel instead of reviews from real people. that's what bugs me as well.

    • @millennyfeng9502
      @millennyfeng9502 Год назад +2

      We're legit!! Can't wait to have you

    • @sergiocoder
      @sergiocoder Год назад

      @@millennyfeng9502 nah, you can't have cause I'm from a banned country

    • @rekcahY
      @rekcahY Год назад

      it's legit but passing the tests may be completely ignored by them. Best way is likely getting into contact with some from there to have real chances.

    • @pinakeekaushik4311
      @pinakeekaushik4311 Год назад

      @@rekcahY Like even after passing all the rounds , do we have to nudge them for reminder? How was your experience can you share. Thanks

  • @Splash-zt7kj
    @Splash-zt7kj Год назад

    Informative

  • @stevenknb3439
    @stevenknb3439 Год назад

    I'm going to take it , any advice?

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      Yeah like I said: don't try to copy paste code - might screw up template. 2. Warm up - make sure you've been programming recently and remember basics. 3. Get to know where debug output goes ) 4. Make a lot of debug output to avoid stupid mistakes. 5. Make sure you fully understood the task. 6. Test resulting code against as many border cases as possible

    • @IgorKravets81
      @IgorKravets81  Год назад +3

      and film it )

    • @themiracle8100
      @themiracle8100 Год назад +1

      @@IgorKravets81 do they require filming a video passing the test ?

  • @MrsDyarvane
    @MrsDyarvane 7 месяцев назад

    has anyone written the python test on turing?

    • @IgorKravets81
      @IgorKravets81  7 месяцев назад

      Not me, sorry

    • @12A2Shareef
      @12A2Shareef 2 месяца назад

      hey i have written python test on turing there was two questions i solved the 2nd question but when i try to solve the first question i mean when i try to run the 1st code it says like "something went wrong while running test please try again after sometime" thereafter when i again logged in my turing account i saw my application got failed :( i dont understand what to do

  • @tmwquavo7459
    @tmwquavo7459 Год назад

    bro this turing bootcamp is free?

  • @AlamKhan-yt9wd
    @AlamKhan-yt9wd Год назад +1

    Did you take another try??

    • @IgorKravets81
      @IgorKravets81  Год назад

      Not yet. I got a fulltime job at a company

    • @AlamKhan-yt9wd
      @AlamKhan-yt9wd Год назад

      @IgorKravets81 very nice. Could you make a video about your current status/job role/update

    • @IgorKravets81
      @IgorKravets81  Год назад +3

      @@AlamKhan-yt9wd I don't think there is anything valuable left to share... Although I went through quite a lot of interviews and also screwed up a bunch of them. But all the advice I possibly could give on those - are already covered on RUclips extensively. I think the best advice there is to take every interview you can - gain experience on passing them

    • @hilalinan3209
      @hilalinan3209 Год назад

      @@IgorKravets81 I tried the practice challenge, the question was not difficult, but when I try to run tests, it failed and it showed errors some places but I never understand why. I would prefer using IDE. I mean the get method of an arraylist yielded an error. There were many errros. it was very sad so I am hesitating to start the code challenge.

  • @igorek9191
    @igorek9191 6 месяцев назад +1

    Zapyataya? Eto po angliski?

  • @andrewknyazkov6877
    @andrewknyazkov6877 Год назад +2

    24:23 леттерс равно с сплит ахаххахаа

  • @gomeztorricellygomez7808
    @gomeztorricellygomez7808 5 месяцев назад +1

    for the second problem
    class Node{
    constructor(data,left=null,right=null){
    this.left = left;
    this.right = right;
    this.data = data
    }
    }
    class BST{
    constructor(){
    this.root = null;
    }
    findMax() { // function to return the max height
    let current = this.root;
    while (current.right !== null) {
    current = current.right;
    }
    return current.data;
    }
    add(data){ //function to add new nodes
    const node = this.root;
    if(node === null){
    this.root = new Node(data);
    return;
    }
    const searchTree = function(node){
    if(data < node.data){
    if(node.left === null){
    node.left = new Node(data)
    return
    }else if(node.left != null){
    return searchTree(node.left)
    }else if(data > node.data){
    if(node.right ===null){
    node.right = new Node(data)
    return;
    }
    }else if(node.right !=null){
    return searchTree(node.right)
    }
    }else{
    return null
    }
    };
    return searchTree(node);
    }
    }
    const bst = new BST();

    bst.add(3);
    bst.add(9);
    bst.add(20);
    bst.add(null);
    bst.add(null);
    bst.add(15);
    bst.add(7);

    console.log(bst.findMax());
    // output : 3

  • @babubabu-ne9li
    @babubabu-ne9li 2 месяца назад

    Not working

  • @mr.pingpong502
    @mr.pingpong502 Год назад

    Do you get another chance to clear the test?

    • @IgorKravets81
      @IgorKravets81  Год назад

      Yes, after several months. I don't remember how much now. I think it is shown at the end of the video

    • @elimusa6764
      @elimusa6764 Год назад

      yes, after 3 months

    • @SYNTHv3
      @SYNTHv3 6 месяцев назад

      @@elimusa6764 Thats cold

  • @shelldog7215
    @shelldog7215 6 месяцев назад +1

    this is my simple solution for first problem, i don't know why we have to use such complex regex like that:
    string input = "a-bC-dEf=ghlj!!";
    string alphabets = "";
    for (int i = input.length() - 1; i >= 0; i--) {
    if (isalpha(input[i])) {
    alphabets += input[i];
    }
    }
    int j = 0;
    for (int i = 0; i < input.length(); i++) {
    if (isalpha(input[i])) {
    input[i] = alphabets[j++];
    }
    }
    problem 2 is also simple too, just some basic recursive

  • @kbyoungblood6948
    @kbyoungblood6948 Год назад

    How many questions does this have?

    • @IgorKravets81
      @IgorKravets81  Год назад +1

      I think there are two. Frankly I don't know )

    • @kbyoungblood6948
      @kbyoungblood6948 Год назад

      @@IgorKravets81 okay, that's not too bad!
      Then how many test do you have to take?

  • @franky1116
    @franky1116 11 месяцев назад

    This env is not confortable at all. Explanation needs constrains too. The challange here is keep your stress out😅

  • @TechManAkhil
    @TechManAkhil 6 месяцев назад

    very easy problem. two pointers

  • @grumpyplays5886
    @grumpyplays5886 3 месяца назад

    bfs on the second one

  • @augustonunesfarias4062
    @augustonunesfarias4062 Год назад

    bruuuh 💀

  • @louispaulet
    @louispaulet Год назад +5

    def reverse_letters_only(S):
    letters = [c for c in S if c.isalpha()]
    reversed_letters = letters[::-1]
    result = [c if not c.isalpha() else reversed_letters.pop(0) for c in S]
    return ''.join(result)

  • @jayangavliyanage
    @jayangavliyanage Год назад +2

    O(n) solution without any unnecessary if conditions (Increases the readability)
    let s = "Aa-D--dEe";
    let frontPtr = -1;
    let backPtr = s.length;
    let outPutArr = [];
    for(let i = 0; i < s.length/2 ; i++)
    {
    let frontCharacter = s.charAt(++frontPtr);
    let backCharacter = s.charAt(--backPtr);
    while(!(/[a-zA-Z]/).test(frontCharacter))
    {
    outPutArr[frontPtr] = frontCharacter;
    frontCharacter = s.charAt(++frontPtr);
    }
    while(!(/[a-zA-Z]/).test(backCharacter))
    {
    outPutArr[backPtr] = backCharacter;
    backCharacter = s.charAt(--backPtr);
    }
    outPutArr[frontPtr] = backCharacter;
    outPutArr[backPtr] = frontCharacter;
    }
    let result = outPutArr.join("");
    return result;

  • @ayushman_sr
    @ayushman_sr Год назад

    def rev(str):
    n = len(str)
    chk = lambda s: ord("z") >= ord(s) >= ord("A")
    p1, p2 = 0, n-1
    str = list(str)
    while p1 < p2:
    if chk(str[p1]) and chk(str[p2]):
    t = str[p1]
    str[p1] = str[p2]
    str[p2] = t
    p1 += 1
    p2 -= 1
    else:
    if not chk(str[p1]):
    p1 +=1
    if not chk(str[p2]):
    p2 -= 1
    return "".join(c for c in str)

  • @jedi10101
    @jedi10101 3 месяца назад

    def reverse_only_letters(string):
    letters = [i for i in string if i.isalpha()]
    letters.reverse()
    ans = ''
    idx = 0
    for i in string:
    if i.isalpha():
    ans += letters[idx]
    idx += 1
    else:
    ans += i
    return ans

  • @santhakumarponraj
    @santhakumarponraj 4 месяца назад

    l = "Ip-09hb==:''opm"
    l = list(l)
    al = []
    sym = []
    for i in range(len(l)-1,-1,-1):
    if l[i].isalpha() ==True:
    al.append(l[i])
    else:
    sym.append([i,l[i]])
    for j,k in reversed(sym):
    al.insert(j,k)
    print(" ".join(l).replace(" ",""))
    print(" ".join(al).replace(" ",""))

  • @andreajr2021
    @andreajr2021 2 месяца назад

    iam junior i just ask chat gpt ,asnwwer use push and pop is leter and other just push as the position :
    function reverseOnlyLetters(S) {
    // Extract letters from the string
    let letters = S.split('').filter(char => /[a-zA-Z]/.test(char));
    // Initialize an array to store the final result
    let result = [];
    // Traverse the original string
    for (let i = 0; i < S.length; i++) {
    // If the character is a letter, pop from the reversed letters array
    if (/[a-zA-Z]/.test(S[i])) {
    result.push(letters.pop());
    } else {
    // If not a letter, keep the original character
    result.push(S[i]);
    }
    }
    // Join the result array into a string and return
    return result.join('');
    }
    // Test cases
    console.log(reverseOnlyLetters("ab-cd")); // Output: "dc-ba"
    console.log(reverseOnlyLetters("a-bC-dEf=ghIj!!")); // Output: "j-Ih-gfE=dCba!!