Algorithm · Ramp · Easy
A rental agency manages listings for studio and one-bedroom apartments, but the recorded bedroom counts are sometimes wrong. You need to fix them by inspecting each listing's description text. You receive two arrays of equal length: descriptions: strings containing the apartment descriptions. numBedrooms: the current (possibly incorrect) bedroom counts, where 0 means studio and 1 means one-bedroom. Return a new array with the corrected bedroom count for every listing,…
Checking your access…