I Challenge You!

I Challenge You!
0
#10

its called next smaller number with same digits

0 Likes

#11

Maybe I’ll get back on there too, I’m in the “Free Code Camp” Clan, there are 373 of us.
I really like codewars, it was a very useful tool for me. However at my level (3rd - 4th kyu) I feel like things get a bit out of control. Not just in difficulty of the task, but difficulty in deciphering what they want you to do.

not all of the challenges are like that though, for instance I solved a Sudoku solver challenge (3 kyu). The premise was easy to understand, but the challenge difficult. It took me between 3 days and a week but it was my favorite codewars challenge. I learned a lot. I love that it was a practical challenge, with a real world application.

Good luck on your challenge,
I might check back in on this topic to see if any interesting codewars challenges come up

0 Likes

#12

I was thinking this sounded familiar but looking back through my solutions section, turns out I did “Next bigger number with the same digits” instead (they actually mention the kata in the description).

It looks like I had trouble with it too, seeing as I commented at the top of my solution "very messy, with unnecessary leftovers from earlier attempts"
that probably means I was up for a long time and when I finally finished I was too tired to refactor. Just submitted and never wanted to see it again :stuck_out_tongue:

Good Luck!

0 Likes

#13

yeah, its the same problem but in reverse, I saw that in the description too, I have the logic down, which really isn’t too bad, but I’m doing it the brute force way and so it takes too long to solve for big numbers and my solution gets rejected. I have to make it smarter and skip over unnecessary calculations. In any event I just started on the backend challenges here and it is taking up most of my time, but I will get back to it.

Question for you, did you mean there are 73 fcc’ers or actually 373, I only see 75 or so in my account, maybe there is another clan I’m not aware of ?

0 Likes

#14

373, if you type “Free Code Camp” rather than “freecodecamp” or anything like that.
I tried a few variations before finding this one, but this had the most members, and P1xt is #14 in the clan rankings so I took that to mean I found the… official unofficial fcc group

I dont know if theres a way to directly look at a codewars clan without joining it, but you can check my allies in my profile. They’re all from that clan.

1 Like

#15

got it , just found a away to merge them by typing Free Code Camp, freecodecamp in my account settings, and now there are 446 people, nice , thanks!

1 Like

#16

no, just checked the description. planning to try some when I have enough spare time. thought it may interest you.

0 Likes

#17

@Dereje1 Wow 4 kyu! I don’t think that I’m there yet. Hopefully I can manage to solve a problem that difficult by the end of my 30 Days Codewar Challenge.

@JashuHB Thanks! The Sudoku solver challenge seems like an interesting problem to solve. I think that I’m going to join the ‘Free Code Camp’ clan too.

@rfprod I appreciate that you pointed them out. I’ll check out the kumite.

If anybody has an interesting challenge that they want to share then I would love to read about it.

0 Likes

#18

I just now solved that problem by reusing my code from bigger number challenge with some changes.
Going over it again and reading that you are using brute force, leads me to wonder if you mean you’re checking every combination of numbers?

for all I know you’re already doing things in the way I’m about to mention, but just in case it helps…

it might help to think of it like this,

as close to the one’s place as possible you need to replace a digit with a digit that’s not only smaller, but is also closer to the one’s place.

for a number, say

num = 70632182348246       

// 6 has no smaller number before it, neither does 4 or 2.
//this leaves 8 as the first digit with a smaller digit that can replace it

 // so we can boil this down to just working with 8246 
// and leave the beginning 7063218234 part for later
//now you just have to figure out how to rearrange 8246 before stitching the result back onto the end of 7063218234

hope that helps simplify things a bit.
Good Luck!

0 Likes

#19

when is the best time to start playing on codewars or coding game? My JS is at initial stage now. Did you guys finish the whole course first or just started playing as soon as possible?

0 Likes

#20

Edit: oops This reply wasn’t aimed at you specifically but to the whole thread.

Just FYI if anyone has gone through all the javascript lessons here on FCC, several of the challenges on codewars are the same as the algorithm challenges here. You might be surprised at the kyu level of some stuff you’ve already done. plus you can port over your answer to codewars for points.

Sometimes a challenge can be re-purposed, and I feel like being able to edit your old code to fit new purposes is a valuable skill. It really highlights the importance of self-documenting code, and commenting your code.

0 Likes

#21

I myself started learning JS with a few weeks of flatiron academys free “bootcamp prep” course, at some point I stopped following that course and found freecodecamp.

so I had at least a few weeks intro even before fcc, but

my earliest codewars solution lists as “3 months ago” (this doesnt seem like long enough ago)
my earliest algorithm on FCC lists as “Jun 17”

I progressed a lot on codewars before finishing up the JS lessons here though.

1 Like

#22

did you try kumite on codewars?

0 Likes

#23

Start as soon as possible.
At initial stage you could limit yourself to 8kyu and 7kyu katas - they cover basics of the language. Most important part is to look how others solved the same kata and compare to your solution - you’ll learn a lot.

2 Likes

#24

I just passed it , but I kinda of cheated by hardcoding 2 large numbers that it had kept on failing with, for the other large numbers I sorted them from small to big and if it was identical after sorting to the original number then I would discard the test entirely (I got that idea from here (http://www.geeksforgeeks.org/find-next-greater-number-set-digits/), I left the remainder of the algo as i had it before and it passed (222 tests), but it would not pass without hardcoding those 2 large numbers, why ? I have no clue, in any event I’ve had enough with it, I am going to review the other solutions to the problem, when I get a chance later, I am sure somebody has already solved it with just 5 lines

Here is another one that had me baffled a month or 2 ago as well, but I have already solved this one,

0 Likes

#25

@JashuHB

Thanks very much guys, I am making my account there and get the idea of it all. You are right, it will set me up from basics. If I find it difficult , I can just learn more and go back to Code wars or coding game. I am actually using Free code camp as a game too, so I am mostly learning outside of Free code camp using P1xt guides, and solving solutions here. Even haven’t done my Tribute page yet here, though I have made couple of websites to practice.

0 Likes

#26

You’re on sir. :wink:

0 Likes

#27

Ok, I’m caught in recursion hell here staring at the screen, and haven’t done linear algebra in ages…

0 Likes

#28

I’ve been trying one from the newsletter

This is an interesting one, because its very deceptively simple. I can easily write code to answer the question, its just way too slow, and that seems like the point. otherwise the problem could be solved by something basic like

function findPosition(num){

var runningNo = 1; // running count for adding numbers
var infNum =""; //string of inf numbers
var ind = -1;

  function longer(){ //add 10k numbers to string of infinte numbers
      for(i = 0; i < 10000; i++){
          
          infNum+= runningNo;
          runningNo++;
      }
  }

  while(ind == -1){ //keep adding numbers until a match is found
    longer();
    ind = infNum.indexOf(num);
  }

  return ind;
  
}

this is just an example solution to show how simple the problem appears to be at first (it works for numbers up to 7 digits or so)

I’ve tried a few different techniques so far but nothing that’s been fast enough.

I do like seeing a high level problem with an easy to understand description though. Even if it takes me forever to solve.

0 Likes

#29

Will you give a try at this one? It’s a golfing one and still in beta, at least I enjoyed solving it:

0 Likes