All Questions
24 questions
3
votes
1
answer
275
views
Array rotation in C++
I am completely new to data structures and algorithms.
I tried this problem on hackerank. I got the desired output but my code wasn't efficient enough to execute in the given time limit.
How can I ...
2
votes
1
answer
1k
views
Codewars: Pick peaks
Pick peaks
Wrote my "hello world" on Thursday, so definitely a beginner. I know some Python, so not a novice to programming in general.
Question
For example, the array ...
6
votes
2
answers
3k
views
Find the largest sum of any slice inside an array
This is the 26th exercise I solved from Codility. It scores 100%. I think I improved a lot since I started with this lessons, around 2 months ago, but still every post I made had things to be improved....
3
votes
1
answer
704
views
Count the number of leaders in both sides (slices) of an array in C#. Codility EquiLeaders task
EquiLeader
A non-empty array A consisting of N integers is given.
The leader of this array is the value that occurs in more than half of
the elements of A.
An equi leader is an ...
2
votes
1
answer
1k
views
Codility's GenomicRangeQuery solution in C#
I've been learning C# for a few months now, and I've done some basic things in java last year. I made a solution for the problem the title states, this is the task description.
Task description
...
2
votes
1
answer
782
views
Codility's count passing cars in opposite directions in C#
I programmed a few things in java and now I'm learning C#. I've been doing exercises from Codility.
The first 3 or 4 were very difficult to me but now I guess I've got the hang of it. This site ...
5
votes
2
answers
2k
views
MaxCounters solution in C# from Codility
I programmed a little in java a while back, and now I'm learning C#.This is the first exercise of "medium" or "respectable" difficulty according to Codility, so I'm pretty pleased of finding out that ...
11
votes
1
answer
2k
views
Earliest time frog can jump to the other side of a river in C#
I'm new to C#, I programmed a little in Java in the past. I had the two previous exercises reviewed here (permCheck, cyclicRotation, with a 100% score, just like this one), and I'm applying what the ...
6
votes
2
answers
2k
views
Codility's Permutation Check in C#
I've made a few things in Java, and now I'm learning C#.
The code passes the tests with 100% final score. I want to know what things can be improved in my code.
Task description
A non-empty array ...
5
votes
1
answer
6k
views
(Codewars) Range Extraction
Kata: https://www.codewars.com/kata/range-extraction/python
A format for expressing an ordered list of integers is to use a comma separated list of either
individual integers
or a range ...
7
votes
1
answer
1k
views
Calculating the number of rooms in a 2D house
I stumbled upon this problem on cses.fi (a problem set for the Finnish Olympiad in Informatics. This problem is in finnish so I'll translate it). I'll describe the problem, present the code and think ...
8
votes
1
answer
7k
views
Rearrange list by modifying the original list, put even-index values at front
I am relatively new to python and I am still trying to learn the basics of the language. I stumbled upon a question which asks you to rearrange the list by modifying the original. What you are ...
0
votes
2
answers
207
views
Verifying if two numbers are equal using ArrayLists
I have some question about the code below. It works correctly, but:
Is there a better/another way to solve the exercise (as an expert would have done:) or mine it's perfectly done?
Also, I don't see ...
2
votes
3
answers
307
views
CodeAbbey #21 Array Counters
I'm trying to learn some Haskell by working my way through the CodeAbbey problems. I really struggled to find a nice functional (but still efficient) way to solve problem #21: Array Counters.
The ...
1
vote
1
answer
3k
views
Converting string elements of an array to upper and lower case, maintaining names of keys
I'm just going through some array exercises in PHP on w3resource. I have just completed:
Sample array :
...