Fr4nk's Posts
Nairaland Forum › Fr4nk's Profile › Fr4nk's Posts
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 |
excanny:Yes sir, that would be great |
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 |
I noticed that a line was too long to be viewed here, So I'm. Sending a screenshot too
|
Fr4nk:replace all with ')'Sorry for not adding comments ![]() |
Altairx440:Done, here's my solution in python
|
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) |
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/ |
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 |
Altairx440:Yes sir, python only, I may learn other languages like Javascript(soon because I want to work with flask or Django), R, C++ or Java or C# later, but being a python expert is d main goal |
Altairx440:Yeah dictionaries / objects are Hashmaps, Any language is allowed sir |
Okay cool, Your calling them objects, aren't they dictionaries lol You sound like someone coming from JavaScript ![]() |
Altairx440:Why is s3 an empty list? |
Here's my solution
|
Second one worked well too |
The first one worked well |
These are way too complex bro, I'll test them out |
You are given an integer, . Your task is to print an alphabet rangoli of size . (Rangoli is a form of Indian folk art based on creation of patterns.) Different sizes of alphabet rangoli are shown below: #size 3 ----c---- --c-b-c-- c-b-a-b-c --c-b-c-- ----c---- #size 5 --------e-------- ------e-d-e------ ----e-d-c-d-e---- --e-d-c-b-c-d-e-- e-d-c-b-a-b-c-d-e --e-d-c-b-c-d-e-- ----e-d-c-d-e---- ------e-d-e------ --------e-------- #size 10 ------------------j------------------ ----------------j-i-j---------------- --------------j-i-h-i-j-------------- ------------j-i-h-g-h-i-j------------ ----------j-i-h-g-f-g-h-i-j---------- --------j-i-h-g-f-e-f-g-h-i-j-------- ------j-i-h-g-f-e-d-e-f-g-h-i-j------ ----j-i-h-g-f-e-d-c-d-e-f-g-h-i-j---- --j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j-- j-i-h-g-f-e-d-c-b-a-b-c-d-e-f-g-h-i-j --j-i-h-g-f-e-d-c-b-c-d-e-f-g-h-i-j-- ----j-i-h-g-f-e-d-c-d-e-f-g-h-i-j---- ------j-i-h-g-f-e-d-e-f-g-h-i-j------ --------j-i-h-g-f-e-f-g-h-i-j-------- ----------j-i-h-g-f-g-h-i-j---------- ------------j-i-h-g-h-i-j------------ --------------j-i-h-i-j-------------- ----------------j-i-j---------------- ------------------j------------------ The center of the rangoli has the first alphabet letter a, and the boundary has the alphabet letter (in alphabetical order). Function Description Complete the rangoli function in the editor below. rangoli has the following parameters: int size: the size of the rangoli Returns string: a single string made up of each of the lines of the rangoli separated by a newline character (\n) Input Format Only one line of input containing , the size of the rangoli. Constraints Sample Input 5 Sample Output --------e-------- ------e-d-e------ ----e-d-c-d-e---- --e-d-c-b-c-d-e-- e-d-c-b-a-b-c-d-e --e-d-c-b-c-d-e-- ----e-d-c-d-e---- ------e-d-e------ --------e-------- https://www.hackerrank.com/challenges/alphabet-rangoli/problem?isFullScreen=false I got this from hackerrank, check out the link for better understanding |
Altairx440:Age mates (I'm guessing you checked my profile). Okay bro My main language is python, I'm still in limbo between intermediate and advanced but I'll try best. I just started Data structures and algorithms so I haven't really learnt Asymptotic notation and all those Big O analysis stuff |
Altairx440:Maybe, just to be clear I no too sabi, but I love a good challenge, so expect rubbish code that works lol ![]() |
WUdec:Okay |
Altairx440:Sure |
WUdec:By working on something exciting I wasn't talking about groundbreaking personal projects or being the next mark zuckerberg, An example of something exciting I would love to participate in is Artificial Intelligence at Deepmind, a lot of "exciting" research and development goes on there, they're at the cutting edge of Artificial Intelligence. Isn't that exciting? Imagine working at NASA or SpaceX, and you're among the brilliant devs working together with the rest of the team (astronauts, aerospace engineers, astrophysicists etc) to put the first man on mars, amazing ryt? There are so many examples of exciting stuff. (But excitement differs from person to person) |
Ayowoleminiyi:Hello, I'm not a beginner and I'm also not a veteran but I would love to be of help ![]() |
avalon7:Data science or Artificial Intelillgence I might be leaning more to the Artificial Intelligence part tho, I'm hoping to study CS at unilorin (since I bleeped up my WASSCE and NECO by not writing further maths), I'm not going to rely on the university to teach me everything, I can definitely learn a few important stuff on my own. |
I really love this site Codewars.com and their coding challenges, I wonder if there are coders here who use the platform, let's meet and maybe we might just form our own clan (maybe we could call it "Naira code ninjas" lol) |
airsaylongcome:I just graduated from high school last year, so I don't really know much about real life, that's why I still believe in coding for the love of it or "passion". |
airsaylongcome:Okay, I understand How about this: Getting paid the Nigerian equivalent of earning $160K in US, Not #160K o ![]() |
airsaylongcome:Devs should be paid what they deserve based on their skills and the services they offer, if an American company is going to pay an American Data scientist $160k then a Nigerian Data Scientist working for the same company with similar skills and qualification deserves similar pay, just because I'm from Nigeria shouldn't make me cheap labour. |
Fmghewzy:Apologies sir, i didn't mean to generalize, its just that some the ones I've met always gave me that impression of coding for a living, Maybe saying `some 9ja devs` would have been better |
Techstar:This is why most US devs have problems getting jobs because they have to compete with blokes in developing countries who will accept low salaries instead of the salaries they deserve |
Sheddy5:Well, yes it does ![]() Unless you're a visual learner who prefers watching videos Python video tutorials are also available to you |
for x in s.split("\r\n"

