All Questions
14 questions
0votes
1answer
253views
Python Logic Gate Circuit Simulator [closed]
I have recently become interested in simulating logic circuits because of a electronics class at school. I have created a functioning simulator for logic gate circuits in Python. My implementation ...
1vote
1answer
208views
Rock paper scissors coding assignment
I had a coding assignment to write a Rock Paper Scissors game. The main task is not to show a solution but rather to test the coding style. The rules are such: Problem: rock is "O", paper is ...
1vote
1answer
385views
Python program to find the substring with concatenation of all words
This is a Leetcode problem: You are given a string, S, and a list of words, L that are all of the same lengths. Find all starting indices of substring(s) in S that is a concatenation of each word in ...
3votes
1answer
99views
(Follow-up) Project Euler #11 Largest Product in a Grid | Cache-optimized + sliding window (C++14)
Original code review: Project Euler #11 Largest Product in a Grid | Cache-optimized + sliding window (C++14) Source: HackerRank & ProjectEuler.net Problem: Largest Product in a Grid In the 20×...
2votes
2answers
156views
Project Euler #11 Largest Product in a Grid | Cache-optimized + sliding window (C++14)
Source: HackerRank & ProjectEuler.net Problem: Largest Product in a Grid In the 20×20 grid below, four numbers along a diagonal line have been marked in red. ...
3votes
0answers
105views
Writing Go object code that respects Go guidelines
I'm learning Go and I wrote this for a programming challenge. It is working (building and running) but I feel the code is not what Go code should be: Am I using the ...
2votes
2answers
4kviews
Designing a book library
Description: Design a book library which maintains the book inventory. The library should allow an user to favorite/un-favorite book. The library should allow an user to rent a book for a given ...
2votes
1answer
610views
Jesse and Cookies
Jesse loves cookies. He wants the sweetness of all his cookies to be greater than value K. To do this, Jesse repeatedly mixes two cookies with the least sweetness. ...
5votes
2answers
6kviews
Mars Rover Simulator
Problem Statement Consider a rover and a plateau of size nxn. The rover takes three type of instructions L,R and M. 'L' and 'R' rotate the rover in the left and right direction. 'M' moves the ...
2votes
1answer
881views
Raindrops in Java
Problem Statement: Write a program that converts a number to a string, the contents of which depends on the number's prime factors. If the number contains 3 as a prime factor, output '...
4votes
3answers
2kviews
Binary string to decimal conversion
Problem Statement: Write a program that will convert a binary number, represented as a string (e.g. '101010'), to its decimal equivalent using first principles Implement binary to decimal ...
4votes
2answers
1kviews
Let's play Scrabble
Problem: Write a program that, given a word, computes the scrabble score for that word. Code: ...
4votes
3answers
2kviews
Count words in a string
Continuing my TDD from exercism. Write a program that given a phrase can count the occurrences of each word in that phrase. For example for the input ...
5votes
2answers
685views
Project Euler #23 Non-abundant sums
I'm having trouble optimizing the Project Euler problem number 23 : A perfect number is a number for which the sum of its proper divisors is exactly equal to the number. For example, the sum of the ...