Skip to content

Instantly share code, notes, and snippets.

@ony19161
ony19161 / gist:d8f21aaa27b9c07fe2ab5707c1665543
Created November 22, 2022 19:08
AddTwoNumber using linked list
void append(ListNode **head_ref, int new_data)
{
ListNode *new_node = new ListNode();
ListNode *last = *head_ref;
new_node->val = new_data;
new_node->next = NULL;
bool isMatchingDiagonalValues(vector<vector<int>>& matrix, int x, int y, int limit, bool isBottomHalf)
{
bool isMatching = true;
if (isBottomHalf)
{
if (x > limit)
return true;
while (y < matrix[0].size() - 1 && x <= limit)
{