LeetCode 1460. Make Two Arrays Equal by Reversing Subarrays — JavaScript

Gary Huang
Dublin so code
Published in
Aug 3, 2024
Delay to Nvidia’s new AI chip could affect Microsoft, Google, Meta: report

https://leetcode.com/problems/make-two-arrays-equal-by-reversing-subarrays/description/

你領500元現金了嗎? 點選我的連結成功開樂天帳戶+登入樂天網銀APP,拿500元現金! 樂天帳戶好康在這 : · 使用行動支付5次,享次月活儲年息1.35%存額無上限 · VIP享每月免費跨提/轉共16次 · 提領日幣手續費優惠8次/月 (推薦序號: JGONGL)

var canBeEqual = function(target, arr) {
return target.sort((a,b)=>a-b).toString() === arr.sort((a,b)=>a-b).toString() ? true : false
};

sort the array O(nlogn)

美國洛杉磯 矽谷 軟體公司參訪 美術館 道奇球賽 USA — LA, SJ / FunkyGary / 88rising — California

--

--

Gary Huang
Dublin so code

Self-taught in programming, currently working as a web developer and also a online course instructor, helping self-taught programmers find employment.