> For the complete documentation index, see [llms.txt](https://coding-9.gitbook.io/untitled/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coding-9.gitbook.io/untitled/insights-and-new-learnings/convert-string-to-integer-in-any-base-and-vise-versa.md).

# Convert String to integer in Any base and vise versa

## Learnings

## Intuition

```
0110 in string

int n = stoi(str, Start_index, Base)
n=6 


ALso number to binary
n=6


Bitset
bitset<size> variable_name;
bitset<size> variable_name(Decimal/String);

We can directly use this also

n=6
string s = bitset<16>(nums[i]). to_string;

https://www.geeksforgeeks.org/cpp-bitset-and-its-application/
```

### Links

<https://leetcode.com/problems/find-unique-binary-string/>
