Bitwise Manipulation

Input: head = [1,0,1]
Output: 5
Explanation: (101) in base 2 = (5) in base 10
Input: head = [0]
Output: 0
Input: head = [1]
Output: 1
Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0]
Output: 18880
Input: head = [0,0]
Output: 0
  • The Linked List is not empty.
  • Number of nodes will not exceed 30.
  • Each node’s value is either 0 or 1.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

So you want to hide your API keys securely?

Codility Lesson 1 (Binary Gap)

Getting started with Bob

CS193p 2021 #5 Properties Layout ViewBuilder

Solving Quantum Annealing based Problems with Gate Model Processors

Why can’t we be friends?

Don’t obsess over code DRYness

Variables, the building blocks of programming

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Newbie Developer

Newbie Developer

More from Medium

On Optimistic Nihilism

Dev Diary #4 — Styling and Testing are Underway

Our Sinful Tongues

Control; Birth & Body