Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [loops]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3 votes
1 answer
89 views

In Java, replace for loop with condition with lambdas [closed]

I want to replace a for loop with a break/return condition inside with a lambda. I think I have a good replacement, but I want ...
Oscar Besga Panel's user avatar
2 votes
1 answer
167 views

Hackerrank "New Year chaos" solution - permute sequence by swapping adjacent terms

I was doing the Hackerrank "New Year chaos" problem. Here is the description: It is New Year's Day and people are in line for the Wonderland rollercoaster ride. Each person wears a sticker ...
user12138762's user avatar
3 votes
1 answer
111 views

Performing tasks on for-loop over thousands of items in Rcpp

I am trying to adapt an R script that I wrote to perform several tasks in a for-loop. The for-loop run over thousands of items, for about 900 times, therefore I would like to optimise my code at the ...
CafféSospeso's user avatar
3 votes
2 answers
294 views

Calculate the base 10 log with loops in Java without using Math

I'm looking for a simple way to calculate the logarithm without using java.lang.Math, just out of interest. Here's my try (I adopted some code parts from this ...
Tobias Grothe's user avatar