arunimaSundar's blog

By arunimaSundar, history, 4 years ago, In English

How many problems did you solve?

  • Vote: I like it
  • -4
  • Vote: I do not like it

| Write comment?
»
4 years ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

Sorry but I am not a woman :P So NO

»
4 years ago, hide # |
 
Vote: I like it +1 Vote: I do not like it

Could solve the first 2 completely...

  • »
    »
    4 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    I solved first 3 completely and 9/10 test cases of 4th

    • »
      »
      »
      4 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Great...could you please share your approach for the 3rd? There were so many cases to handle, couldn't figure out a universal solution... 4th was dp I guess which I am yet to learn:)

    • »
      »
      »
      4 years ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Are you among the winners?

      • »
        »
        »
        »
        4 years ago, hide # ^ |
        ← Rev. 5  
        Vote: I like it 0 Vote: I do not like it

        The winner list is released — Link

        arunimaSundar — You should be in top 3.

        Also, for Prisonners of Baskerville, did you solve completely? I missed a few cases, specifically, 7th, 8th, and 10th.

        Any idea what could be the issue?

        • »
          »
          »
          »
          »
          4 years ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          My code passed all the testcases.Initially I was missing out the test case 0 0 0 0 ...,i.e, when all the cells were empty and there wasn't a single prisoner. Maybe you were missing out the same.

          • »
            »
            »
            »
            »
            »
            4 years ago, hide # ^ |
             
            Vote: I like it 0 Vote: I do not like it

            How did you guys solve Prisoners of Baskerville? I tried 2 pointers, but it failed a few cases as well.

            • »
              »
              »
              »
              »
              »
              »
              4 years ago, hide # ^ |
              ← Rev. 3  
              Vote: I like it 0 Vote: I do not like it

              I used a greedy approach tbh... First stored the sum of all the elements of the array in a variable (say sum).Then initialized a variable (say ind) with -1. Next, found out the first index starting from the left which had non-zero value and updated the ind with that index value.Then iterated the array from ind+1 till the the last second index and stored the count of all the zeros in a variable(say cnt). Finally the answer would be (sum+cnt)*input2 (input2 was the given cost of shifing the prisoners)...BUT do keep a check for the edge case 0 0 0 0... (when there are no prisoners at all).This case can be handled in the sum part only(if sum==0 then return 0).

      • »
        »
        »
        »
        4 years ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Not in the top 10 though:( but any idea from where we can get the list of the top 50?

        • »
          »
          »
          »
          »
          4 years ago, hide # ^ |
           
          Vote: I like it 0 Vote: I do not like it

          I think the winners would have received a mail. Strange, the questions were quite hard, and not sure how so many people got all correct, as the person who solve 3.9/4 doesn't got into the list..

»
4 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

Cannot participate:sadge: