https://zyrastory.com/wp-includes/js/jquery/jquery.min.js
https://zyrastory.com/wp-includes/js/jquery/jquery-migrate.min.js
jQuery(document).ready(function(){document.querySelectorAll(".ez-toc-link").forEach(t=>{t=t.replaceWith(t.cloneNode(!0))}),document.querySelectorAll(".ez-toc-section").forEach(t=>{t.setAttribute("ez-toc-data-id","#"+decodeURI(t.getAttribute("id")))}),jQuery("a.ez-toc-link").click(function(){let t=jQuery(this).attr("href"),e=jQuery("#wpadminbar"),i=jQuery("header"),o=0;30>30&&(o=30),e.length&&(o+=e.height()),(i.length&&"fixed"==i.css("position")||"sticky"==i.css("position"))&&(o+=i.height()),jQuery('[ez-toc-data-id="'+decodeURI(t)+'"]').length>0&&(o=jQuery('[ez-toc-data-id="'+decodeURI(t)+'"]').offset().top-o),jQuery("html, body").animate({scrollTop:o},500)})});
(function(c,l,a,r,i,t,y){ c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i+"?ref=bwt"; y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); })(window, document, "clarity", "script", "btkbh92jgl");
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();
for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }}
k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");ym(93103491, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
跳至主要內容
文章觀看次數: 143
前言 距離上一篇的LeetCode 註冊及簡單介紹已經過了半年多了 (這裡看上一篇 )
最近回去檢視著那篇,發現最重要的解題區還是缺了點,不夠詳細
這次剛好趁著介面改版一併介紹
介面介紹
⬆ 看到右下角的 NEW 按鈕了嗎,按下去就可以切換成新版的樣式 ⬇
左邊又分為4個分頁,新舊版有些微的差異
舊版依序為 : Description 、Solution 、Discuss 、Submissions
新版依序為 : Description 、Discussion 、Solutions 、Submissions
分頁1 : Description 說明 由上而下,分別是題目、Examples 範例、Constraints 題目限制
有些題目會有 Follow-up 也就是進一步/進階 的意思,像是這題就是問能不讓時間複雜度小於 O(n2 )
Companies 公司 這是個需要訂閱才有的功能,會顯示這題在各大公司面試出現的頻率及次數
Related Topics 則是相關的主題,這題相關的是 Array 陣列 及 Hash Table 雜湊表
Similar Questions 類似的題目
Show Hint 題目的提示 ( 以前從來沒注意有這個,汗顏…
分頁2 : Solution 官方解答 / Discussion 討論 舊版 :
官方提供的解答,不一定每題都有 ( 解答影片的話是要訂閱才有的功能 )
提供的語法也不一定,比較常見的有 Java / Python
新版 :
⬆新版介面的第二個區塊則改為 Discussion 討論區
大家可以看到上面的 Discussion Rules 討論區規則
不要在這裡貼任何解答 題目討論區 是用來詢問與題目相關的問題或分享訣竅/小技巧 – 任何東西,除了解答以外 如果你想要分享您的解答,請到解答區分享
重要的事情要強調3遍 !!! 可以看出官方極力說明不要 PO 解答在這裡呢哈哈
分頁3 : Discuss 討論/ Solutions 解答 舊版 :
就是個大家丟解答上來的地方,偶爾會有人在下面留言討論
新版 :
會把自己發布過的解答排在上面方便尋找
另外舊介面中的官方解答也會置頂
分頁4 : Submission 提交紀錄舊版 :
⬆ 依時間排序,由左到右顯示了提交時間、提交狀態、運行時間、記憶體使用狀況、使用語言
⬇點進去會跳轉 到 Detail頁
會有圖表顯示贏過幾成的提交 ( 運行時間跟記憶體使用 )
不過也只能當作參考,畢竟同一個答案有時也會差上不少,視 LeetCode那邊的主機狀況而訂哈哈
新版 :
⭐增加了Filter功能 ,可以針對提交狀況或語言進行篩選
⬆ 點下明細是直接在右側顯示,不是跳轉了,上面也有 Close 可以隨時關閉
另外大家可以看到「Notes」跟「Related Tags」這兩項
可以自由寫些小筆記跟選擇相關的標籤,後面還會用到
休息一下,喝口水
上面介紹完左側的介面了
接下來換介紹右邊的答題區
答題區相信大家都比較熟悉
舊版 :
右上的 Icon 功能分別為
編輯器快捷鍵 載入上一次提交的程式 還原為預設的程式 > 僅有function名稱之類的 編輯器設定 ( 字體、主題 … 等 ) 全螢幕
Testcase 則是測試案例,可以自己新增,也可以用下面的「Use Example Testcases」
另一個分頁則是Code運行的結果
新版 :
新版最直觀的就是Testcase 跟 Result 變的友善多了
多筆的顯示,不像之前都是一整個text區塊
另外,右上角的 Icon 也有些變化,功能依序為
提交紀錄筆記 載入上一次提交的程式 還原為預設的程式 編輯器快捷鍵 編輯器設定 ( 字體、主題 … 等 ) 全螢幕
除了順序有點小改變之外,這次新增了一個功能
還記得上面的筆記嗎,點擊這個 icon就會跳出之前有寫過筆記的提交紀錄
⬆ 會自動篩選當前語言,當你選擇並按下 Confirm之後,就會自動載入那次的程式碼了
結論 這次介面改版算是深得我心
有哪個工程師能抗拒黑色的介面 呢 !!
( Visual Studio、Eclipse…等IDE 調成黑色的朋友們,舉起你們的手 ~ )
設計感上也比較好 > 線條的柔和程度、新的圖示
整體使用者體驗也提高了許多
提交紀錄可針對狀態、語言進行篩選 增加Note 方便查找紀錄
這次就先介紹到一段落了
範例的這一題解答可以看這 : LeetCode #1 Two Sum 解題思路及翻譯 – zyrastory程式美食研究中心
相關文章
LeetCode是什麼? LeetCode 介面操作及經驗分享 – zyrastory程式美食研究中心
function closePop(){document.getElementById("headlineatas").style.display = 'none';}
function openPop()
{
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))
{
return false;
}
var r = Math.random();
if(r>0.7 || r<0.3)
{
document.getElementById("headlineatas").style.display = '';
}
}
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
(adsbygoogle = window.adsbygoogle || []).push({});
function returnDefault(item)
{
item.innerText = "Copy"
item.style.color = "white"
item.style.backgroundColor = "CornflowerBlue";
}
if(/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) == false) //20221128 手機用戶移除copy功能
{
jQuery('code').each(function () {
var btn = document.createElement("button");
btn.innerHTML = "Copy";
btn.onmousedown = "event.preventDefault();";
btn.setAttribute('class', 'btnC');
btn.onclick = function(){
var k = this.nextSibling;
var textArea = document.createElement("textarea");
textArea.style.position = 'fixed';
textArea.style.top = 0;
textArea.style.left = 0;
textArea.style.width = '2em';
textArea.style.height = '2em';// We don't need padding, reducing the size if it does flash render.
textArea.style.padding = 0;// Clean up any borders.
textArea.style.border = 'none';
textArea.style.outline = 'none';
textArea.style.boxShadow = 'none';// Avoid flash of the white box if rendered for any reason.
textArea.style.background = 'transparent';textArea.value = k.textContent;document.body.appendChild(textArea);
textArea.focus();
textArea.select();var successful = document.execCommand('copy');
var msg = successful ? 'successful' : 'unsuccessful';if(successful)
{
this.focus();
this.style.backgroundColor = "green";
this.innerText = "✔Copied"
openPop();
setTimeout(( ()=>returnDefault(this)),1850)
}document.body.removeChild(textArea);
};var parent = this.parentNode;
parent.insertBefore(btn, this);
});
}
https://zyrastory.com/wp-content/plugins/easy-table-of-contents/vendor/js-cookie/js.cookie.min.js
https://zyrastory.com/wp-content/plugins/easy-table-of-contents/vendor/sticky-kit/jquery.sticky-kit.min.js
var ezTOC = {"smooth_scroll":"1","visibility_hide_by_default":"","scroll_offset":"30","fallbackIcon":"<span class=\"\"><span style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span>"};
https://zyrastory.com/wp-content/plugins/easy-table-of-contents/assets/js/front.min.js
https://zyrastory.com/wp-content/plugins/highlighting-code-block/assets/js/prism.js
var hcbVars = {"showCopyBtn":"","copyBtnLabel":"Copy code to clipboard"};
https://zyrastory.com/wp-content/plugins/highlighting-code-block/build/js/hcb_script.js
var ct_localizations = {"ajax_url":"https:\/\/zyrastory.com\/wp-admin\/admin-ajax.php","nonce":"00ac813cc8","public_url":"https:\/\/zyrastory.com\/wp-content\/themes\/blocksy\/static\/bundle\/","rest_url":"https:\/\/zyrastory.com\/wp-json\/","search_url":"https:\/\/zyrastory.com\/search\/QUERY_STRING\/","show_more_text":"\u986f\u793a\u66f4\u591a","more_text":"\u66f4\u591a","search_live_results":"\u641c\u5c0b\u7d50\u679c","search_live_no_result":"\u627e\u4e0d\u5230\u7b26\u5408\u7684","search_live_one_result":"\u60a8\u5df1\u627e\u5230 %s \u500b\u7b26\u5408\u7684. \u8acb\u6309 Tab \u9375\u4f86\u9078\u64c7\u5b83.","search_live_many_results":"\u60a8\u5df1\u627e\u5230 %s \u500b\u7b26\u5408\u7684. \u8acb\u6309 Tab \u9375\u4f86\u9078\u64c7\u5b83.","expand_submenu":"\u5c55\u958b\u4e0b\u62c9\u9078\u55ae","collapse_submenu":"\u6536\u5408\u4e0b\u62c9\u9078\u55ae","dynamic_js_chunks":[],"dynamic_styles":{"lazy_load":"https:\/\/zyrastory.com\/wp-content\/themes\/blocksy\/static\/bundle\/non-critical-styles.min.css","search_lazy":"https:\/\/zyrastory.com\/wp-content\/themes\/blocksy\/static\/bundle\/non-critical-search-styles.min.css"},"dynamic_styles_selectors":[],"lang":"zh"};
https://zyrastory.com/wp-content/themes/blocksy/static/bundle/main.js
https://zyrastory.com/wp-includes/js/comment-reply.min.js
(function() {
var expirationDate = new Date();
expirationDate.setTime( expirationDate.getTime() + 31536000 * 1000 );
document.cookie = "pll_language=zh; expires=" + expirationDate.toUTCString() + "; path=/; secure; SameSite=Lax";
}());
ai_front = {"insertion_before":"BEFORE","insertion_after":"AFTER","insertion_prepend":"PREPEND CONTENT","insertion_append":"APPEND CONTENT","insertion_replace_content":"REPLACE CONTENT","insertion_replace_element":"REPLACE ELEMENT","visible":"VISIBLE","hidden":"HIDDEN","fallback":"FALLBACK","automatically_placed":"Automatically placed by AdSense Auto ads code","cancel":"Cancel","use":"Use","add":"Add","parent":"Parent","cancel_element_selection":"Cancel element selection","select_parent_element":"Select parent element","css_selector":"CSS selector","use_current_selector":"Use current selector","element":"ELEMENT","path":"PATH","selector":"SELECTOR"};