Ad

Find the bomb inside the list of boxes. a Box can contains boxes, in other word Recursive. You need to find the bomb and than give the box code, so the CIA agent can defuse it.

constraints:

should throw an error if sent empty array
should return solution with string format ([Box_code] >?)+, example: "B1 > B1.3 > B1.3.1 ... B.n"

interface ListOfBoxes {
  code: string,
  bomb?: boolean,
  boxes?: ListOfBoxes[]
}

export function findTheBomb (listOfBoxes: ListOfBoxes[]): string{
  // You Can Code Below Here  
 
  return ``
}

I Have An Array With Type Number

const point: number = [20, 10, 100, 40, 5, 50];

Can You Filter To Show Data With Criteria On Below:

  1. More Than Equal 10
  2. More Than Equal 40
  3. More Than Equal 100
export function filteringDataMoreThanEqual (data: number[], comparator: number): string{
  return String(data);
}

I Have An Array With Type iType On Below Here

interface iType {
subject: string,
point: number
}

const data: iType[] = [
{
subject: "IPA",
point: 70,
},
{
subject: "MTK,
point: 65
}
];

Can You Find The Value Of The data Above Using Following Formula:

value = total_of_point / total_of_data;

export interface iType {
  subject: string,
  point: number
}

export function valueResult (data: iType[]): number {
  let value = 0;
  // You Can Code Below Here
  
  return value;
}

I Have An Array With Types From Interface iType

interface iType{
id: number,
name: string,
};

const data: iType[] = [
{
id: 1
name: "Manny"
},
{
id: 2
name: "Danny"
},
{
id: 3
name: "Socciella"
},
];

Can You Show Only One Data From That Array By ID?

export interface iType{
  id: number,
  name: string,
}

export function findData (data: iType[], selectedData: number): iType {
  // You Can Code Here
  
}

Search The Longest Word from a sentence. if there's 2 or more word with same largest length, you need to return no longest word found,
example:
I really love to learn and do experiment with typescript
here, experiment and typescript have the same length 9.
so the solution is no longest word found.

constraints:

  1. should throw an error if sent empty argument
  2. should throw an error if sent non string argument
  3. should return solution with string format [word]: [length] chars
  4. should return no longest word found if there's 2 or more word found.
export function findTheLongestWord (sentence?: string): string{
  // You Can Code Below Here  
  return ``
}

I Have a Constants With Type String There's On Below

const text: string1 = "B0002";
const text: string2 = "B0000001";
const text: string3 = "B0000004";

Can You Take The Number And Convert it To Number Type

export function takeANumber (text: string): number {
  // Don't Change This Variable
  let result: number = 0;
  // You Can Code Below Here
  
  return result;
}

I Have A String There's In Below

const array: string = "I Love Typescript";

Can You Take The First Word From These Text?

export function takeFirstWord (text: string) {
  
}