FIND YOUR NEXT FEW LINES

Results for “per”

Small, practical examples. Search by task or narrow things down below.

447 snippets foundClear filters
JavaQueues & collection operations

Find set members missing from another set

Java: Use removeAll on a copy to calculate a set difference.

Java✓ Tested
JavaQueues & collection operations

Find shared set members

Java: Copy a set before retainAll when the original must remain unchanged.

Java✓ Tested
C++Ordering & set operations

Find sorted set members missing from another set

C++: set_difference writes elements present in the first sorted input but absent from the second.

C++✓ Tested
C++Ordering & set operations

Find the common members of two sorted sets

C++: set_intersection requires both input ranges to be sorted under the same comparator.

C++✓ Tested
JavaScriptUTC date operations

Find the final day of a month

JavaScript: Day zero of the following UTC month selects the previous month’s final day.

JavaScript✓ Tested
TypeScriptUTC date operations

Find the final day of a month

TypeScript: Day zero of the following UTC month selects the previous month’s final day.

TypeScript✓ Tested
PowerShellArray operations

Find the index of an array item

PowerShell: Array.IndexOf returns -1 when the requested item is absent.

PowerShell✓ Tested
C++Ordering & set operations

Find the insertion position for a sorted value

C++: lower_bound returns the first position whose value is not less than the search key.

C++✓ Tested
JavaScriptUTC date operations

Format whole seconds as hours minutes and seconds

JavaScript: Use integer divisions and remainders for a nonnegative duration.

JavaScript✓ Tested
TypeScriptUTC date operations

Format whole seconds as hours minutes and seconds

TypeScript: Use integer divisions and remainders for a nonnegative duration.

TypeScript✓ Tested
CSmall algorithms & bit operations

Generate a bounded Fibonacci sequence

C: Keep only the two previous values instead of using exponential recursive calls.

C✓ Tested
C++Ordering & set operations

Group matching values while preserving their order

C++: stable_partition keeps the relative order within both predicate groups.

C++✓ Tested