NewStats: 3,259,756 , 8,170,842 topics. Date: Sunday, 25 May 2025 at 10:40 PM 20s286z3e3g |
Let us see the real programmers. Not Every Time Here Frontend, Backend, React. (1412 Views)
(1) Go Down)
turmacs(f): 6:02pm On Jun 12, 2024 |
You can attempt the problem with any language you are comfortable with. Problem statement you are given an n by m grid (n is the number of rows and m is the number of columns), the grid only contains just the characters '*' and '#', a whole manhattan circle exit's on the grid. The coordinates of the top left corner and bottom right corner of this grid are (1,1) and (n,m) respectively. The point (a,b) is a part of the manhattan circle which is centered at (h,k) if | h - a | + | k - b | < r , where r is a positive constant and | x - y | represents the absolute value of x - y. On this grid, all points that are a part of the manhattan circle are denoted by the '#' character. Your task is to find the coordinates of the circles center. Input The first line contains t ( 1 <= t <= 1000) --- The number of testcases. The first line of each testcase contain n and m (1 <= n *m <= 2*105) which both stand for the height and width of the grid respectively. The next n lines contain m characters that are either '.' or '#'. If the character is '#', then you know that the point is a part of the circle. Output For each t, your code has to print two integers, the coordinates of the circles center. Example Input 6 5 5 ***** ***** **#** ***** ***** 5 5 **#** *###* ##### *###* **#** 5 6 ****** ****** *#**** ###*** *#**** 1 1 # 5 6 ***#** **###* *##### **###* ***#** 2 10 ********** ***#****** Output 3 3 3 3 4 2 1 1 3 4 2 4 Let us see those that are real programmers ![]() nlfpmod mynd44 farano dominique, is this fun enough for front page? |
RealLordZeus(m): 6:09pm On Jun 12, 2024 |
I no get strength to attempt without money ![]() ![]() |
turmacs(f): 6:50pm On Jun 12, 2024 |
RealLordZeus:na so, just say you can't solve it, nobody will mock you. |
RealLordZeus(m): 6:52pm On Jun 12, 2024 |
turmacs:yes you are right |
airsaylongcome: 8:30pm On Jun 12, 2024 |
OP, you know that there's AI that can write fully functional code that solves this. I Just threw it at my "weak" self hosted LLM and it has churned out Python and C++ code that look workable
1 Like |
turmacs(f): 8:47pm On Jun 12, 2024 |
airsaylongcome:Lolzzz.. Except your "LLM" or "AI" is better than chatgpt, i don't think it can solve this one because chatgpt could not solve it. No be by cho , cho , cho, show workings ![]() |
Adonisty: 8:58pm On Jun 12, 2024 |
turmacs:is this a new avatar of Devdevdev? Sounded like a female version of Tastedfriedpussy |
PulsingPurple(m): 9:41pm On Jun 12, 2024 |
Sorry I'm trying to edit this post but Nairaland and their Cloudflare keeps rejecting
|
PulsingPurple(m): 9:42pm On Jun 12, 2024 |
PulsingPurple(m): 10:27pm On Jun 12, 2024 |
turmacs: Hope Cloudflare finally allows me to post 😑 This is the updated response from Google's Gemini Advanced After getting the first code which I've removed, I tried to run it but it didn't run, so the AI debugged the code till it eventually ran... 2 Likes |
turmacs(f): 10:36pm On Jun 12, 2024 |
PulsingPurple:Wow this is actually correct and I am really surprised that it could solve it (although this a very easy problem). Chatgpt just solved nonsense. So no software engineer on NL could solve this till now? wonderfull. |
airsaylongcome: 10:46pm On Jun 12, 2024 |
turmacs:
1 Like |
PulsingPurple(m): 10:47pm On Jun 12, 2024 |
turmacs: I heard ChatGPT is better than Gemini... It would have probably debugged it's error code if you kept on directing it... The developers here are probably tired Let AI assist them 😅 |
airsaylongcome: 10:57pm On Jun 12, 2024 |
PulsingPurple: I'm surprised they earlier said ChatGPT couldn't solve it. Just running llama3 on a Raspberry pi could churn out correct code in different languages. Let alone throwing the compute power of ChatGPT. OP needs to learn Prompt Engineering PS: Just realized how old school I am. I'm only comfortable with C++ or Java source code |
PulsingPurple(m): 11:07pm On Jun 12, 2024 |
airsaylongcome: Prompt Engineering sounds like one of those complex grammar people choose to use for simple matters, everyone should just be aware of how to force the AI to spew desired info (lol). ... Right now I'm more concerned with the thought that you have a Raspberry Pi, and that it runs your own isolated LLM... Is this what techies do with their free time? I thought it'll be only Americans... Have you heard of ChatBawa the Nigerian LLM... (it's a failed project currently) You may want to their team 🙂 |
airsaylongcome: 11:16pm On Jun 12, 2024 |
PulsingPurple: I no dey any Nigerian blah blah blah...our matter too dey get problem. Regarding the Pi, it's not running a self built LLM o. It's Ollama with llama3 model. I'm trying to train it to see where I get...yes there are some airheads like us who consider this as "free time toy". Prompt Engineering is actually developing into a Career! Seen some $50/hr job postings around it. And yes, it is big grammar for the prompt you provide the AI |
PulsingPurple(m): 11:53pm On Jun 12, 2024 |
airsaylongcome: Na play oo 😂
Yh I know it's not self trained... Shebi it's Llama3 na... It's just this Pi stuff Just like Indian techies will buy Arduino and program small gadgets... It's sha cool I usually get annoyed at those Fiverr guys and their ridiculous pricing for this AI stuff. Just like people charging the elderly so much just to install apps and put music on their newly bought smartphone. |
airsaylongcome: 12:40am On Jun 13, 2024 |
PulsingPurple: For the Pi stuff, hmmmm make I no talk too much o. I've got several single board computers mostly Pis, Odroids and NanoPi So if I'm not messing about with Home Assistant or openHAB, I'm running a router(openwrt) or a PBX or something esoteric. 2 Likes |
danielclerkson(m): 3:46am On Jun 13, 2024 |
turmacs:Please, break down the question and answer so that we the entry level devs can learn. Thanks |
tosinhtml: 8:28am On Jun 13, 2024 |
turmacs: So DevDevDev is no longer anonymous? She has finally showed us her real ![]() ![]() ![]() |
turmacs(f): 8:30am On Jun 13, 2024 |
tosinhtml:Who is this DevDevDev abeg? ![]() |
Shomek(m): 8:50pm On Jun 13, 2024 |
airsaylongcome:nice one sir |
Paystack(f): 11:09pm On Jun 13, 2024 |
turmacs:Mad woman. How much are you paying... you have gone to solve it with ChatGpt and it couldn't solve it for you after all your trials you yourself couldn't solve it. I know you went to Google and get the answer somewhere then brought the question here to console yourself thinking everyone is dumb like you. No one self should waste time trying to solve it for you as you just want to ridicule people and console yourself instead of learning. Fork u! |
MindHacker9009(m): 3:37am On Jun 14, 2024 |
turmacs: Software Engineers on NL will not waste their valuable time on such a tasks that lack commercial viability. Such tasks you posted from Leetcode are typically more suited for university mathematics students who are learning to apply programming to solve their mathematical exercises. Here is an example of what Software Engineers on NL will spend their valuable time on: Implement a piece of online software suitable for use by a cinema. The system should be capable of providing information about films currently showing, and of the availability of seats in the cinema. The system should allow for seats to be booked either individually or as a block. For example a block of 3 seats would require 3 adjacent seats to be booked together. 3 Likes |
danielclerkson(m): 4:34am On Jun 14, 2024 |
MindHacker9009:Along with the front end ? |
MindHacker9009(m): 4:38am On Jun 14, 2024 |
danielclerkson: Yeah with the front-end. |
danielclerkson(m): 4:46am On Jun 14, 2024 |
MindHacker9009:The main back end gra-gra is checking if a seat has been booked, because only js will do the info of movie (using an API) but you can also use js all through, just store the seating info on the local disc |
MindHacker9009(m): 5:03am On Jun 14, 2024 |
danielclerkson: The main part is checking all the rows to see if 3 adjacent seats are available to be booked.
|
danielclerkson(m): 5:09am On Jun 14, 2024 |
MindHacker9009:The individuals data will be linked to a specific number or code. These codes have designated seats based on bookings. If the code has 3 consecutive seats, it is now a block. (a while loop will work) |
turmacs(f): 7:08am On Jun 14, 2024 |
Paystack:Look at this one ![]() |
turmacs(f): 7:14am On Jun 14, 2024 |
MindHacker9009:Bro please keep quiet, you always talk reason like what i don't know. You could not solve it be say you could not solve it, this is a leetcode style problem so you're telling me it's university students that should be doing leetcode? Okay when you get to your next interview and they give you leetcode style problem, tell them that one. You will not waste time to solve a simple problem that would not take more than 15 LOC to solve, but you have time to type all this gibberish? Ohh please ![]() |
turmacs(f): 7:37am On Jun 14, 2024 |
For those that might be interested in how to think about the solution.... First of all you need to understand that this problem is not as mathematical as some might have thought, because I assumed that after reading the second paragraph some people who are not math inclined will lose hope, it's just pure implementation problem with very very little math, basically just addition and subtraction. I don't know what that MindHacker9009 guy is saying, university mathematics students ![]() You have to observe that the points that are part of the circle are always in a diamond shape and are symmetrical from the middle column. All you have to do is to find the first appearance of '#' character because the first appearance will always be the on the same column as the center of the circle ( the row and column that it's found on) and to find the row that the center appears on, just count the number of '#' in the middle column, divide that count by 2 (to find the position of the middle) then add whatever you get to the row number that the first '#' was on. Sorry if my explanation is hard to understand by here is my C++ solution to the problem, you can use chatgpt to convert to any language of your choice to understand it.
1 Like |
(1) Reply)
C++ Gurus: Urgent Help Needed.
(Go Up)
Sections: How To . 69 Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland. |