₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,330,965 members, 8,447,994 topics. Date: Sunday, 19 July 2026 at 01:21 PM

Toggle theme

LogicDcoder's Posts

Nairaland ForumLogicDcoder's ProfileLogicDcoder's Posts

1 2 3 4 5 6 (of 6 pages)

Christianity Etc. by logicDcoder(op):
.
Christianity EtcRe: Mummy G.O: My Visit To Olufunmilayo Adebayo's Church - Simisola Sowole by logicDcoder(m): 5:46pm On Jan 09, 2022
grin grin You’re lucky sha, had it been the my caught you.
Christianity Etc. by logicDcoder(op):
.
Christianity EtcRe: “O Lord Cubana Me And Make Me Sit At Home” Church Poster Reads by logicDcoder(m): 9:31pm On Sep 27, 2021
Mtcheeew.... This doesn't look real. One jobless shit will be designing all this poo to get useless attention!
EducationRe: Are You Now Working In Big Companies? by logicDcoder(m): 5:07pm On Sep 04, 2021
While in junior secondary school I helped some friends with answers sha during exams, but D I don't knw I was damaging me (They all ganged up against me when I had issues with my academics). I promised me that I will never make that mistake again now that I'm in university.
Christianity Etc. by logicDcoder(op):
.
EducationRe: David Odekunle Accepted Into 7 Ivy League Colleges by logicDcoder(m): 9:52pm On Apr 30, 2021
I celebrate U bro!!! Fire On!!!
EducationRe: Victory Yinka-Banjo Gets 19 Scholarship Offers Worth $5m From US And Canada by logicDcoder(m): 9:44pm On Apr 30, 2021
Lemme celebrate this kids ooo... One day una go hear say I don break records too. Their brain na FIRE!!!
Christianity EtcA Must Read!!! by logicDcoder(op): 5:02pm On Feb 09, 2021
Chukwuemeka Emmanuel Okeke is a young man called in the Prophetic Office and gifted with the gift of healings, word of knowledge, word of wisdom, prophecy and teaching grace. ceoministryng

Chukwuemeka Emmanuel Okeke is from a small town called NIBO, in Anambra State, Nigeria. From the family of Chief Raphael N. Okeke. He has three other brothers. Prophet Chukwuemeka Emmanuel Okeke – CEOMinistryng
Chukwuemeka Emmanuel Okeke first realized the calling of God upon his life through a book writing by Benny Hinn (Welcome Holy Spirit and Good Morning Holy Spirit) at the age of 18. Although because of the lack guidance and teachers of the word of God around him, he dived into the Entertainment Industry by building a social dating network called FRIENDITE which lead him into studying COMPUTER SCIENCE and into the social media world.

His company by name FRIENDITE GLOBAL LIMITED gained massive boost and was named as Nigeria’s largest dating site with over 60,000 users in just few months after lunch. Although he later shut down the site after 5 years to answer the call of God upon his life in 2017.

The death of his mother in 2018 pushed him to building a deeper relationship with God, as his mum was the one person that strongly supported him moving into the ministry and guided him into the things of God.

Prophet Chukwuemeka Emmanuel Okeke has been mentored an imparted by the likes of Apostle Steve Chibueze, Rev. Dr. Umar Ukpai, Evangelist GodsPower, Apostle Arome Osayi, Apostle Tochukwu Okonkwo, Passion Java etc.

Join Us Our Telegram Channel: https:///prophetemmanuelokeke
Website: https://ceoministryng.com/

ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 8:01am On Feb 05, 2021
Week 2 -> Bonus Problem:
Honorable Mentions: SUPREMOTM iAmChidiebere 404Dev Excallibur

ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 4:07pm On Feb 04, 2021
iAmChidiebere:
Python
1st image: Redundant comments for the sake of newbies
2nd image: Reduced comments. More tidy
3rd image: Execution


Cc: logicDcoder
Nice one boss. grin
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 12:04pm On Feb 03, 2021
iAmChidiebere:
Number 3....
when nepa brings light
I can't wait ooo
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 12:03pm On Feb 03, 2021
iAmChidiebere:
Question 2
Java
Kudos boss!
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 10:04pm On Feb 02, 2021
SUPREMOTM:
QUESTION 1
LANGUAGE JavaScript
IDE: Bracket



Since no factor of a number can be greater than half of the number, besides itself, I made the loop control variable have a maximum value of half the number.

So as to be able to test the function with valid perfect numbers, I had to also create a function that gets all the perfect numbers from 1 to 100000, the function returned 4 numbers.

The results of the tests are displayed on Chrome browser console window.
I really learnt something here kudos boss!
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 8:49pm On Feb 01, 2021
Question 1 and 3 Solved

Observation: Only even numbers can be perfect!

SUPREMOTM 404Dev iAmChidiebere mention others please!

ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op):
[Week 2 Questions]

1: In number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number. Write a function | isPerfectNumber( ) | that checks if a number is a perfect number or not return True if it's a perfect number and False if it's not.
https://en.wikipedia.org/wiki/Perfect_number

2: Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number. (A proper divisor of a number is a positive factor of that number other than the number itself. For example, the proper divisors of 6 are 1, 2, and 3.) A pair of amicable numbers constitutes an aliquot sequence of period 2. It is unknown if there are infinitely many pairs of amicable numbers.
Simple Example : (220,284) 220 is divisible by {1,2,4,5,10,11,20,22,44,55,110 } <- Sum = 284 and 284 is divisible by -> 1,2,4,71,142 and the Sum of that is. Yes right you probably expected it 220. Write a function (AmicableNumbers(int startValue, int StopValue) ) that finds all the amicable numbers in the range Start-value -> Stop-value and also time the function inother to know the time it took to find the pairs of numbers!

https://en.wikipedia.org/wiki/Amicable_numbers

3: Spice up Number 1 question by finding the Odd, Even and Prime perfect numbers in a custom range example: 1 -> 1000, 1000 -> 3000. What do you observe?
Honorable Mentions: SUPREMOTM iAmChidiebere 404Dev
GOOD LUCK!
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 6:34pm On Feb 01, 2021
Alert!
Next set of problems will be posted either tonight or tomorrow!
I really want to use this opportunity to thank SUPREMOTM , iAmChidiebere , 404Dev and logicDcoder for their modest contributions!

You Guys Are The Best!
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 1:47am On Jan 31, 2021
Excallibur:
on Python
Great!
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 1:15am On Jan 31, 2021
404Dev:
The solution in javascript.

Well commented so newbies can follow through.

We could eliminate the first if check but I just left it there so it would be easier for newbies to follow along.

const arr = [3, 6, -2, -5, 7, 3]

/**
* Returns the max product of adjacent elements of input array
* @param inputArray
* @returns {number}
*/
function adjacentElementsProducts(inputArray) {
// Define our max number and initialize it as zero
let max = 0;

// Loop through the input array
for (let i = 0; i < inputArray.length; i++) {
// If this is the first iteration set max to the first element * the next element
if (i == 0) {
max = i * inputArray[i + 1];
} else {
// First check if we have a next element and compare the product of the next two elements
if ((i + 1) != inputArray.length && (i * inputArray[i + 1]) > max) {
// set our max if applicable
max = i * inputArray[i + 1];
}
}
}

return max;
}


console.log(adjacentElementsProducts(arr));
Hope you tested your code with different arrays
ProgrammingRe: Thread For Nairaland Algorithm Questions by logicDcoder(m): 12:32am On Jan 31, 2021
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op):
Second Problem. It's quite easy all you have to do is convert, extract and then sum.

cc: lahp 404Dev Grandlord

ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 1:14pm On Jan 30, 2021
lahp:
no more questions?
Three per week
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 12:11am On Jan 30, 2021
Karlebolu:
I hope this thread doesn't die like others.
Help the thread by solving a problem
SportsRe: Roman Abramovich Has Dished Out £112.5M In Compensation To Sacked Chelsea Bosses by logicDcoder(m): 6:03pm On Jan 29, 2021
Lol this man seff
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 6:02pm On Jan 29, 2021
Grandlord:
Make we reason time complexity for we solutions? If na so abeg indicate the big O wey our solution suppose run. I know say na mostly O(N) sha.


Abeg wey you get the questions from?
You don't need to know any of this when solving this kind of problem here in nairaland. CP sites like Topcoder, CodeSignal , Hackerrank etc requires the knowledge of time complexity. Bro just study each problem and try and solve 'em.(Here you don't have any time or memory limit).

I got it from CodeSignal
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op): 10:42pm On Jan 28, 2021
tensazangetsu20:
This is for the gods of programming. I don japa grin grin.
Where you dey go?... Relax and learn
ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op):
Problem 1 Solution:

PL used: Java

The approach was quite easy.
Pseudo Code
[1] Iterate the array and multiply the adjacent elements and then compare the product with the variable containing the max product.
[2]If the product of the adjacent element is greater than that of the variable containing the max product then assign the value of the product of the adjacent element to the variable containing the max product.

ProgrammingRe: A Thread For Competitive Programming by logicDcoder(op):
WEEK 1:
Well will start from the easy ones:

ProgrammingA Thread For Competitive Programming by logicDcoder(op):
Good Morning NL!

This thread is meant for programmers [noob] that want to sharpen their problem solving skills using any programming language. The OP of the thread will be posting two/three algorithmic problems here every week.

READ ME: Anybody can contribute his/her own solution but make sure to provide the pseudo code. You can use any programming language of your choice. To submit your solution screenshot your IDE and post the resulting image here(A well commented code don't need a pseudo code). Scroll Down To See Week 2 Questions.

Thread Official Languages: English/Pidgin English

NB: Try and solve the problems first before consulting Mr Stackoverflow.

Ogah Seun, Mukina2 and lalasticlala let's give this thread a chance *smiles*

Thanks
Okeke Enoch Chibuzo
ProgrammingRe: Programmers Are Good In Mathematics by logicDcoder(m): 9:33pm On Jan 28, 2021
Programmers make use of a branch of mathematics known as discrete math. You don't have to be guru at math to learn how to program. It also depends on the level you're operating on.

1 2 3 4 5 6 (of 6 pages)