# DPKG Error : Sub-process /usr/bin/dpkg returned an error code (1)

While installing some software using linux terminal, we may encounter error like this

### Sub-process /usr/bin/dpkg returned an error code (1)

I got this error while installing a library file “libpam0g:i386”.

Just see the 4th line of this error.

#### dpkg: error processing /var/cache/apt/archives/libpam0g_1.1.3-7ubuntu3_i386.deb (–unpack):

The error can be rectified by using the command

# Problem Statement

Given a range to b, we have to all numbers which have prime number of divisors.

Eg: In the range 1 to 10 , the numbers are 2, 3, 4, 5, 7, 9

For a brief problem statement visit this link.

# PROBLEM STATEMENT:

You are given a very large rectangular chocolate bar. You must cut only as 1 x 1 pieces. You are allowed to do only ‘K’ cuts at the maximum. What is maximum number of chocolate pieces can u cut ?

# Problem Statement

In short, You are given a string containing only characters R,G,B. We can remove the string from either end at each move( from left or from right). Finally, the string must contain only R or G or B.

You can find a detailed problem description here.

# Problem Statement

Let ‘A’ be a R x C  Matrix. Elements in ‘A’ are filled from 1 to R*C in row-major order. ‘B’ is also a R x C Matrix where the elements are filled in column-major order.

Find number of cells which satisfy the property Ai,j ==  Bi,j.

# Problem Statement

In a nutshell, Given a M x N Matrix we have to check whether it is possible to visit all the cells starting from any location.

Moving Direction – If you are in the cell (x,y), you can only move to ( (x+1)%M, (y+1)%N )

You can find a detailed problem description here.

# Bit Tricks

The basic Bit Operations are & (AND) , |(OR) , ^(X-OR), ~(Negation).

Checking nth bit set or not

Let ‘x‘ be the given number.

(x & (1<<n)) >> n

Setting the nth bit of number

x = ( x | (1<<n) )