All Questions
181 questions
6
votes
7
answers
1k
views
Filter non-even elements from an array
I have a method that returns an int[]. The array is made by filtering out only the even values of the array passed into the method.
It works, but it's really ugly ...
5
votes
3
answers
339
views
Implementation of arrays that store their size
In this code I implemented arrays that store their own size before the first element. To access it you need to go back exactly sizeof(size_t) bytes back. To free it,...
6
votes
4
answers
2k
views
Automate character search in C
THE TASK
We are dealing with a string of symbols and need quick responses to queries of the following types:
What is the position of the k-th occurrence of symbol X in the string?
Reading from ...
4
votes
2
answers
2k
views
Linked list and array list performance comparison in C
After watching Stroustrup's presentation on performance comparison between vectors and linked lists (https://youtu.be/YQs6IC-vgmo?si=9r5wXqnwkmN29xqn), I've decided it would be a good problem to get a ...
2
votes
0
answers
84
views
Javascript basic search engine recipes
I have made a search engine for recipes. Requirements for this JS Project are as follow:
Create a function called searchRecipes that takes all recipes and an ...
5
votes
4
answers
2k
views
Automate the boring stuff with python - Character picture grid
Character Picture Grid
Say you have a list of lists where each value in the inner lists is a one-character string, like this:
...
0
votes
1
answer
107
views
Printing Permutations
Following is a leetcode problem:
Given an array nums of distinct integers, return all the possible permutations. You can return all the possible permutations. You can return the answer in any order.
...
2
votes
1
answer
85
views
Helper functions to get, set and remove from Firefox browser storage. Also, to get, push and remove from lists stored in the database
I am making a plugin for Firefox, this is (more or less) my first time working with JavaScript. Is this a reasonable design for working with both values and lists in a database?
...
1
vote
2
answers
469
views
Simple snake game with C and raylib
Made a simple snake game using C and raylib for graphics, Would like to be critiqued on the clearity and efficiency of the code.
...
4
votes
1
answer
949
views
Writing a Java program that outputs a calorie/macronutrient plan for getting in shape over a certain amount of weeks
I am new to programming and was working on a project that calculates an entire "diet plan" as well as a projected weight goal for each week.
There are three objects that all have methods ...
2
votes
1
answer
138
views
How many times element of one array occurs in another array?( HackerRank sparse arrays problem)
with basic knowledge of multiset and vectors in c++ I solved the following problem.
How can I improve my code and also handle any input errors?
Problem statement:
There is a collection of input ...
3
votes
1
answer
274
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
117
views
Another generic dynamic arrays in C
Wrote this (and others not here) as an exercise to explore how generics could be implemented in C.
Question -- if I were to support out-of-band error setting, how would that look like for ...
0
votes
2
answers
2k
views
1
vote
3
answers
342
views