Algorithm · Salesforce · Medium
Initially you have a rectangular sheet of paper with height h and width w. Your task is to transform it into a rectangle of height h1 and width w1 by repeatedly performing a fold operation. In one fold, you choose one of the current sides (either the vertical side representing height or the horizontal side representing width) and fold the paper along that side. When folding a side of length x, you select a folding distance d (with 1 = ceil(x / 2). You may perform folds in…
Checking your access…