Results for “ring”
Small, practical examples. Search by task or narrow things down below.
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
Flatten a single nesting level
JavaScript: flat defaults to a depth of one and creates a new array.
JavaScript✓ Tested
Flatten a single nesting level
TypeScript: flat defaults to a depth of one and creates a new array.
TypeScript✓ Tested
Generate a bounded integer range
JavaScript: Array.from supplies each output position to its mapping function.
JavaScript✓ Tested
Generate a bounded integer range
TypeScript: Array.from supplies each output position to its mapping function.
TypeScript✓ Tested
Group matching values while preserving their order
C++: stable_partition keeps the relative order within both predicate groups.
C++✓ Tested
Identify headers for individual table rows
HTML: Scope row associates the first header cell with the data cells in that row.
HTML✓ Tested
Insert values into a multiline template
PowerShell: A double-quoted here-string expands variable references.
PowerShell✓ Tested
Join rows in a chosen order
Aggregate text with STRING_AGG and WITHIN GROUP.
STRING_AGG✓ Tested
Join text rows in a chosen order
Combine values using string_agg.
string_agg✓ Tested
Join words with a separator
Join words with a separator using a complete Go program with explicit sample inputs.
Go✓ Tested
Keep a callback stable between renders
Keep a callback stable between renders with a small React component and explicit browser behavior.
React✓ Tested