Tag Archives: STL

Count pairs whose products exist in array

Given an array, count those pair whose product value is present in array. Examples: Input : arr[] = {6, 2, 4, 12, 5, 3} Output : 3 All pairs whose product exist in array (6 , 2) (2, 3) (4, 3) Input : arr[] = {3, 5, 2, 4, 15, 8} Output : 2 A… Read More »

C++ bitset interesting facts

Bitset is a container in C++ Standard Template Library for dealing with data at the bit level. A bitset stores bits (elements with only two possible values: 0 or 1). We can however get the part of a string by providing positions to bitset constructor (Positions are with respect to string position from left to… Read More »