₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,344,219 members, 8,510,733 topics. Date: Friday, 30 October 2026 at 11:05 PM

Toggle theme

Cbrass's Posts

Nairaland Forum › Cbrass's Profile › Cbrass's Posts

1 2 3 4 5 6 7 8 ... 10 11 12 13 14 15 16 17 18 (of 179 pages)

Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 10:36pm On Jan 19, 2021
Brukx:
Lemme just drop this here

Question
Write a function that takes user input. The input must be either 7 or 4. If the input is 4, the function should return 7. If the input is 7, the function should return 4. Do not use if or else statements. Do not use exceptions.
Ah!! Karleb have you seen this question? we have crazy questions on Nairaland o grin grin
I am loving this.
SO no conditional statement at all? embarassed
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 10:32pm On Jan 19, 2021
Karleb:
So take a positive integer, push it into the array, pop the same integer and return it. Easy. grin

function returnInteger(value) {
let arr = []
arr. push(value)

return arr.pop()
}
grin grin grin grin grin
see my solution, though you are right too, you got me there
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 10:15pm On Jan 19, 2021
Deicide:
If I get this Question correctly, You are asking to find the maximum element in an Array?

You also said to use pop and push, that doesn't make any sense cause you only use that with Stack data structure and not Arrays.

This Question doesn't even require Finding max of Anything based on the input data huh
i have a reason for asking that you use pop and push, you can use this in array manipulations though and also i dont want to give too much hint so the question doesn't look to easy though it is very easy
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 5:07pm On Jan 19, 2021
Karleb:
The only method I know does not allow push/pop, the one that does is a whole stack object.

Give more hints.

Edit.

I just thought of something, a sort algorithm would solve this. Sort the array in asc or desc order and pop out the last or first value. Even if in future another value is pushed to the array, the sort algorithm will take care of the order.

Is this the solution? Lemme write it.
well you were coming close to the solution until i saw your code. don't forget the input is not an Array..the input is a positive integer just like the hint i gave annd you must return an interger too..in fact from the hint you should already know how the ALgorithm will be
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 11:58am On Jan 19, 2021
meobizy:
Lol.
why laughing nw
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 11:55am On Jan 19, 2021
Karleb:
I'm guessing this will require a stack data structure?
not really bro... wink
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op): 11:54am On Jan 19, 2021
SqueezedPant:
Good morning ,I've been looking for a site where I can see questions like this to improve my JavaScript skill , can you suggest some?
thanks in advance
Hackerrank or Leetcode is fine
Programming › Re: Thread For Nairaland Algorithm Questions by cbrass(op):
Write a function that returns the maximum number N of an array using the following functions POP and PUSH in your code
HINT: Input = 15, Output = 15, input = 10 Output = 10

Modified
Please find the image below for the solution.
I purposely didn't want to give more hint, cheesy
From the question you aught to create an array from the given input.

Programming › Thread For Nairaland Algorithm Questions by cbrass(op): 3:03am On Jan 19, 2021
Hi my fellow coders, i think we should have our own mini Hackerank or Leetcode here too.
I just feel like we should challenge our selves by posting OUR OWN algorithm questions here.

Please let these questions BE YOUR OWN QUESTIONS and not copy and paste from other sites!!

I will suggest that we let a question be answered before posting another one,
If a question is not solved within a day the questioner will modify the post to include the solution.

I will go first grin
Programming › Re: Lagos Bred Software Developer Joins Big Global Tech Company Stackoverflow by cbrass(m): 2:43am On Jan 19, 2021
Hongkog:
Congratulations.
Yoruba people are damn intelligent and have been making Nigeria proud since 19AD.
Please take your stupid tribalism to the politics section.
we don't do that here !! angry angry
Programming › Re: Life Of A Phone Programmer by cbrass(m): 10:28pm On Jan 18, 2021
sonofnos:
Not really Sir. And I am open to engineers that can fix this.
Call This number +234 708 687 0520 his name is Ige. He is on whatsapp too.
Just say from Caleb.
Programming › Re: Life Of A Phone Programmer by cbrass(m): 10:10pm On Jan 18, 2021
@karleb thanks for the mention.
I have been battling with some Algorithm questions since morning.

so back to the problem, you have spent too much on the system, the money could have gotten you a new laptop.
Also are you trying to fix it your self?
why not give it to a capable engineer.
There is one i do use , if you are interested let me know.
Cheers bro
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 9:16am On Jan 18, 2021
brightology3:
pls I need an assistance. there is this website I saw last week Monday or Tuesday, a monika advertised it, where someone can do online test for waec, jamb etc.

assure.net or something. pls I need the correct website as I misplaced where I wrote it.
for jamb you can take tests on utme.com.ng
Programming › Free Leetcode Questions by cbrass(op): 3:32pm On Jan 14, 2021
hello, please if you have free Leetcode questions kindly share o
abeg grin
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 3:27pm On Jan 14, 2021
HOLRANGE:
Would you be nice enough to get me through the page to see for myself
sure . wink
https://facebook.com/postume
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 12:58pm On Jan 14, 2021
HOLRANGE:
Do you live in any of these areas?
Apapa, Surulere, Yaba Ajegunle and Ojo

If yes, are you writing medical related subjects for your jamb?
Physics, Chemistry and Biology

If you fall in the categories above and you need a private tutor, but physically and virtually that could help you through preparation for jamb class send an email to us or reach me on what$app 0-8-1-32356249
for as low as 5k i can help you advertise to an audience of 12k jambite on our UTME page
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 6:38pm On Jan 13, 2021
blesszzy:
Hi,

2020 jamb or downwards?
2020
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 2:27pm On Jan 13, 2021
blesszzy:
Yes!
PLease what is the procedure to change it ?
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 8:24am On Jan 13, 2021
how can i change my birthdate on jamb?/
is it even possible?
Webmasters › I Need Help With Fiverr Gigg by cbrass(op): 3:12pm On Jan 12, 2021
hello guys,
I am just trying my hands on fiverr again after awhile and i am not getting any gig at all from clients.
IS there anything i am not doing right?
or are there secrets to getting gigs on fiverr?
kindly help a brother in need oo grin grin
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 12:10pm On Jan 12, 2021
chemK:
Get yourself prepared to excel in chemistry with Mastering calculations in chemistry by oguntuase. A.A. call08068806047.
for as low as 5k i can help you advertise to an audience of 12k jambite on our UTME page
Education › Re: JAMB UTME 2021 Thread by cbrass(m): 12:08pm On Jan 12, 2021
Trill2:
I'm Trill Taiwo Ebuka the Physics tutor of Nigeria best online college: The Right Tutors Online College (TRTOC). In our 2020 UTME record 50% of our students scored 300+ ranging from 355-300. DM via WhatsApp if you are interested in the great college. https:///2349071051151 or for private Tutoring.
for as low as 5k i can help you advertise to an audience of 12k jambite on our UTME page
Webmasters › Re: Google Removes Parler From Play Store by cbrass(op): 2:03pm On Jan 09, 2021
Sabowest:
Omo you dey whine my nipple, I noe say u dey use am throw work
hehehehe...i don't understand you o
Webmasters › Re: Google Removes Parler From Play Store by cbrass(op): 12:57pm On Jan 09, 2021
Sabowest:
Wetin you wan use Parler do??
i am just curious
Foreign Affairs › Re: Reddit, Twitch, Shopify, Discord Ban Donald Trump by cbrass(m): 10:42am On Jan 09, 2021
you will just make this man more popular and also make his fans wilder.

Just let him be
Webmasters › Google Removes Parler From Play Store by cbrass(op): 10:32am On Jan 09, 2021
Some couple of months back I still saw the app on play store but I tried to install the app today and discovered that it has been removed from playstore.

This crack down on free speech is getting too far oo..

Education › Re: JAMB UTME 2021 Thread by cbrass(m): 10:13am On Jan 08, 2021
if you are a coaching center and wants to advertise to audience of at least 12k jambites, you can chat me up now at 08034879983.
i charge 5k per post, the post won't be removed. it will be there for ever.
i willl give you the facebook page and you can see the number of engagements we get daily on the facebook page
Technology Market › Re: Affordable Inventory Software For Sale by cbrass(op): 7:24pm On Jan 06, 2021
still available grin
Technology Market › Re: Affordable Inventory Software For Sale by cbrass(op): 8:46am On Jan 06, 2021
still available grin
Technology Market › Affordable Inventory Software For Sale by cbrass(op): 6:49pm On Jan 05, 2021
Do you run a service or you own a store that requires:
An automated inventory.
Point Of Sale.(both wholesale & Retail).
Sales Report
Receipt/Waybil generation.


We will set it up for you on your server so that you don't have to pay monthly/yearly.
we will also give you 3months support for free.
Cost of setup and Installation is also free.

Then get in-touch with us to see a demo.

Call/Chat : 08034879983
Email: info@calebadeleye.com
Programming › Re: Xmas Codes by cbrass(m): 1:55pm On Jan 03, 2021
Akanimoh113:
Damn... Then where do I get a Hacker
Do you know any Hacker?
you are funny o..its like u coming yo a public forum to ask for the services of an Assassin

maybe u should create a separate thread for it
Programming › Re: Xmas Codes by cbrass(m): 7:28am On Jan 03, 2021
I mean Saving that type of sentence as a constant is kind of..

1 2 3 4 5 6 7 8 ... 10 11 12 13 14 15 16 17 18 (of 179 pages)