Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(args) {
- var arr = args[0].split("\n");
- var array1 = arr[0].trim().toLowerCase();
- var array2 = arr[1].trim().toLowerCase();
- var n1 = array1.length;
- var n2 = array2.length;
- if (n1 < n2) {
- console.log("<");
- return;
- }
- else if (n1 > n2) {
- console.log(">");
- return;
- }
- else {
- if (n1 === n2 && array1.localeCompare(array2)===0) {
- console.log("=");
- return;
- }
- else {
- for (var i = 0; i < n1; i++) {
- if (array1[i].localeCompare(array2[i])===-1) {
- console.log("<");
- return;
- }
- if (array1[i].localeCompare(array2[i])===1) {
- console.log(">");
- return;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement