Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,205,003 members, 7,990,761 topics. Date: Thursday, 31 October 2024 at 11:56 PM |
Nairaland Forum / Science/Technology / Programming / Codewars.com Coding Challenges (2844 Views)
Coding Challenges As A Newbie. / CODELAGOS: 337 Schools To Participate In Coding Competition / Do We Have Coding Bootcamps In Nigeria? / Faster Way To Learn Web Development. (2) (3) (4)
Re: Codewars.com Coding Challenges by Fr4nk(m): 7:45pm On May 19, 2022 |
excanny:Nice I haven't started doing it yet, I was busy with a tough codewars kata (write a function to check if a sudoku solution is valid or not) I'll start now |
Re: Codewars.com Coding Challenges by excanny: 8:06pm On May 19, 2022 |
Fr4nk: Can you share the problem? |
Re: Codewars.com Coding Challenges by Fr4nk(m): 8:14pm On May 19, 2022 |
excanny: https://www.codewars.com/kata/53db96041f1a7d32dc0004d2 Write a function done_or_not/DoneOrNot passing a board (list[list_lines]) as parameter. If the board is valid return 'Finished!', otherwise return 'Try again!' Sudoku rules: Complete the Sudoku puzzle so that each and every row, column, and region contains the numbers one through nine only once. Rows: There are 9 rows in a traditional Sudoku puzzle. Every row must contain the numbers 1, 2, 3, 4, 5, 6, 7, 8, and 9. There may not be any duplicate numbers in any row. In other words, there can not be any rows that are identical. In the illustration the numbers 5, 3, 1, and 2 are the "givens". They can not be changed. The remaining numbers in black are the numbers that you fill in to complete the row. Columns: There are 9 columns in a traditional Sudoku puzzle. Like the Sudoku rule for rows, every column must also contain the numbers 1, 2, 3, 4, 5, 6, 7, 8, and 9. Again, there may not be any duplicate numbers in any column. Each column will be unique as a result. In the illustration the numbers 7, 2, and 6 are the "givens". They can not be changed. You fill in the remaining numbers as shown in black to complete the column. Regions A region is a 3x3 box like the one shown to the left. There are 9 regions in a traditional Sudoku puzzle. Like the Sudoku requirements for rows and columns, every region must also contain the numbers 1, 2, 3, 4, 5, 6, 7, 8, and 9. Duplicate numbers are not permitted in any region. Each region will differ from the other regions. In the illustration the numbers 1, 2, and 8 are the "givens". They can not be changed. Fill in the remaining numbers as shown in black to complete the region. Valid board example: For those who don't know the game, here are some information about rules and how to play Sudoku: http://en.wikipedia.org/wiki/Sudoku and http://www.sudokuessentials.com/ |
Re: Codewars.com Coding Challenges by Fr4nk(m): 8:17pm On May 19, 2022 |
Fr4nk: The easy part was that I'm not new to sudoku and I solve a good number of puzzles for fun or pass time, I even remember building a sudoku solver using recursion and backtracking techniques (it was long ago, maybe i'll try it again but without the tutorial lol) |
Re: Codewars.com Coding Challenges by Fr4nk(m): 11:20pm On May 19, 2022 |
Altairx440: Done, here's my solution in python
1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 11:22pm On May 19, 2022 |
Fr4nk: replace all with ')' Sorry for not adding comments 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 11:27pm On May 19, 2022 |
I noticed that a line was too long to be viewed here, So I'm. Sending a screenshot too 1 Like
|
Re: Codewars.com Coding Challenges by excanny: 12:28am On May 20, 2022 |
Great. |
Re: Codewars.com Coding Challenges by excanny: 12:29am On May 20, 2022 |
You mind if we have a group with like minds. So we can always solve the challenges. Need people who are consistent and passionate for competitive programming 2 Likes |
Re: Codewars.com Coding Challenges by Altairx440: 8:12am On May 20, 2022 |
Fr4nk:Cool, Of the languages you listed, it only R I haven't used before. You should really consider learning JavaScript bro, IMHO. |
Re: Codewars.com Coding Challenges by Altairx440: 8:15am On May 20, 2022 |
excanny:Nice one bro. We should be posting our code, that's the only way we'd be able test it for correctness. Also consider refactoring it into a function so it would be easier to test. |
Re: Codewars.com Coding Challenges by Altairx440: 8:27am On May 20, 2022 |
Fr4nk:Works well, nice one. 1 Like |
Re: Codewars.com Coding Challenges by Altairx440: 8:31am On May 20, 2022 |
Fr4nk:It's ok, I just have to click "Quote" to get the full code. BTW what editor/IDE is this? 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 8:49am On May 20, 2022 |
Altairx440:The one in the picture is just a text editor for android with syntax highlighting (it doesn't run code) I'm actually using a web based editor called onecompiler.com I write all my codes and test them there, because I don't have a laptop now so I'm using my Android Tablet 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 8:53am On May 20, 2022 |
excanny: Yes sir, that would be great |
Re: Codewars.com Coding Challenges by Altairx440: 9:16am On May 20, 2022 |
Fr4nk:Ok bro, I like the theme of the editor. |
Re: Codewars.com Coding Challenges by Altairx440: 9:18am On May 20, 2022 |
excanny:What kind of group do you have in mind? |
Re: Codewars.com Coding Challenges by excanny: 9:59am On May 20, 2022 |
Altairx440: WhatsApp is fine |
Re: Codewars.com Coding Challenges by excanny: 10:11am On May 20, 2022 |
Fr4nk: You have to loop through the 2D array. You have to check that the rows and columns don’t contain duplicate values. A hashset can do that job. You also check that the values are within 0-9. Finally you check that the 3 x 3 matrices don’t contain duplicates. 1 Like |
Re: Codewars.com Coding Challenges by Altairx440: 10:17am On May 20, 2022 |
excanny:I do think we're too few to form an active group, plus getting new members would be another thing to consider. |
Re: Codewars.com Coding Challenges by Fr4nk(m): 10:30am On May 20, 2022 |
excanny: Yeah on point, the hardest part for me was validating each of the 9 3x3 regions, Here's what I did tho I found a way to convert the 3x3 region into a 1D array and validate it just like you did for the rows and columns |
Re: Codewars.com Coding Challenges by Altairx440: 12:41pm On May 20, 2022 |
Fr4nk:# My solution:
|
Re: Codewars.com Coding Challenges by Fr4nk(m): 7:16pm On May 20, 2022 |
Altairx440:It works. Great job. But please try dey comment your code boss It's the same approach as mine but with a different implementation, which is actually cool 1 Like |
Re: Codewars.com Coding Challenges by Houstency(m): 7:17pm On May 20, 2022 |
Just started learning Python this week via HNI internship and a total newbie to programming. Kudos guys, I like what you guys are doing, should be able to join you guys as I progress lol. Tips, tricks etc to aid my learning would be highly welcomed. 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 7:21pm On May 20, 2022 |
My solution.py def done_or_not(board): #board[i][j] 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 7:23pm On May 20, 2022 |
It's the nested forloops for me 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 7:25pm On May 20, 2022 |
Houstency:Thank you and welcome to the club boss, we can't wait to see your codes |
Re: Codewars.com Coding Challenges by Altairx440: 10:05pm On May 20, 2022 |
Fr4nk:Yeah, I don't really fancy comments lol, that's why I use mostly descriptive function and variables name, I only use comments when it's absolutely necessary. |
Re: Codewars.com Coding Challenges by Altairx440: 10:09pm On May 20, 2022 |
Fr4nk:Four nested loops is no joke lmao. |
Re: Codewars.com Coding Challenges by Temmylee01(m): 9:13am On May 29, 2022 |
I'm getting my laptop tomorrow morning, nd I should be starting to learn programming this week. My prob now is who to put me through since I'm in abj. 1 Like |
Re: Codewars.com Coding Challenges by Fr4nk(m): 4:40pm On May 29, 2022 |
Temmylee01: Cool bro, but your location doesn't matter, I learnt recursion from a professor in Germany right from my home here in Lagos, learn to make the internet your greatest weapon as a programmer, its not cheating even if you ask google for something as simple as "how do I terminate a for loop", forget that BS that people say about relying too much on Google for your answers, You need to Google everything if you have to because nobody in abuja or anywhere else will be able to answer all your questions, Watch tutorials on YouTube, and read programming blogs you'll be okay |
Re: Codewars.com Coding Challenges by Temmylee01(m): 7:12am On May 30, 2022 |
Fr4nk:I agree with you, but those YouTube class are somehow complicated reason is they hardly explain very well. The guy will just be talking and talking. 1 Like 1 Share |
New Glo Unlimited Data Cheat / Greatest Programming Books (Must Have!) / Who Can Solve This Problem Using Java
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 72 |