Qualcomm Interview Question
Software Engineer / DevelopersLinkan Chen: lkchen1128@gmail.com
If the code have problem, hope you can contact me.
vector<string> StringArray;
CreateTeleNum(vector<string> NumArray, char[] A, string StringNum,int i, int j, int level){
if(level==0){
for(int i=0;i<3,i++){
for(int j=0;j<4;j++){
if(A[i][j]!='*' && A[i][j]!='#'){
string ss;
ss.append(A[i][j];
CreateTeleNum(NumArray,A,ss, i, j,level+1);
}
}
else if(level<6){
string2=stringNum;
string2.append(A[i][j]);
CreateTeleNum(NumArray,A,StringNum,i,j,level+1);
if( (i+1<3)&&(j+2)){
if(A[i+1][j+2]!='*' && A[i+1][j+2]!='#'){
............................
}
}
.................
consider other 4 situation
}
else if(level==6){
NumArray.push_back(StringNum);
}
Here is the code...
- gauravk.18 February 29, 2008